Add a Logout Button in Header for Discourse Themes

AI-generated summary

A theme component titled ‘Add a Logout Button in Header for Discourse Themes’ was introduced by pinder99, offering a logout button in the header with installation instructions and a preview link. Initially, users Don and MihirR reported the component as non-functional, prompting pinder99 to update the code. After updates, MihirR confirmed functionality and suggested improvements: showing either text or icon (not both) and simplifying the install section to just the repo link. Jagster noted UI inconsistencies on iPad and iPhone. Monikas requested an option to hide the logout text, which NateDhaliwal addressed by opening a PR to add that setting. The topic was temporarily unlisted by Falco until code was ready, then relisted after fixes. The component allows CSS customization to hide either the icon or text via provided snippets.

:information_source: Summary Add a logout button in header
:eyeglasses: Preview GitHub - pushpinder6805/logout-header · GitHub
:hammer_and_wrench: Repository REPOSITORY_LINK
:question: Install Guide How to install a theme or theme component
:open_book: New to Discourse Themes? Beginner’s guide to using Discourse Themes

Install this theme component

A button in header to logout users

Screenshots…
image
image

Detailed description…

To remove logo

.logout svg{
    display: none;
}

To remove text

.logout span {
display:none;
}

Hello :waving_hand: it looks like this component is empty and doesn’t do anything in this state…

2 Likes

+1, I can reproduce this error.

1 Like

Please wait updating code

1 Like

I have unlisted this topic until code is provided.

3 Likes

i have added the code , please list the topic

please check

Installed and checked; it works perfectly fine. Just two suggestions:

  1. It would be great to have either the logout text or the logout icon, but not both.
  2. In the Install this theme component section, it would be better to include only the repository link for easy installation.

I’ve attached the snippet below for your reference.

There could be some need to tune up a bit.

iPad:

iPhone:

Could you add an option to cancel the text? Thank you.

@Monikas I’ve opened a PR to add a setting to do just that:
https://github.com/pushpinder6805/logout-header/pull/1

1 Like