Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add button to toggle theme in header #2980

Merged
merged 1 commit into from
Sep 7, 2022
Merged

Add button to toggle theme in header #2980

merged 1 commit into from
Sep 7, 2022

Conversation

LudvigHz
Copy link
Member

The button is an icon that switches based on the current theme. If the
user is logged in, the theme will also be persisted to the
backend.

@LudvigHz LudvigHz added enhancement Pull requests that make enhancements, instead of just purely new features future-was-2-years-ago Pull requests that introduce technologies which should have been "long" ago review-needed Pull requests that need review labels Aug 23, 2022
Copy link
Member

@ivarnakken ivarnakken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to work nicely! 💯 Next out is making the dark theme actually functional 😆

app/components/Header/ToggleTheme.js Outdated Show resolved Hide resolved
Comment on lines 218 to 239
<ToggleTheme
loggedIn={loggedIn}
updateUserTheme={this.props.updateUserTheme}
username={this.props.currentUser?.username}
/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this look on mobile? The .buttonGroup is already very cramped (note: we should reduce the gap on mobile). I think I would prefer not to have the toggle in the header on mobile, which sites like Vite and Docker do as well.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, but I think it should be in the user drop-down or something on mobile, so it's not too hard to get to.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added it to the dropdown now (when logged in)

@ivarnakken ivarnakken added the changes-requested Pull requests with requested changes label Aug 23, 2022
@LudvigHz
Copy link
Member Author

Screencast.from.08-30-2022.11.25.57.PM.webm

image
image

The button is an icon that switches based on the current theme. If the
user is logged in, the theme will also be persisted to the
backend.
Copy link
Member

@ivarnakken ivarnakken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks awesome now 💯

@ivarnakken ivarnakken added approved Pull requests that have been approved ready-to-merge Pull requests that have been approved and are ready to be merged and removed review-needed Pull requests that need review labels Sep 7, 2022
@ivarnakken ivarnakken merged commit 3ca864e into master Sep 7, 2022
@ivarnakken ivarnakken deleted the theme-switcher branch September 7, 2022 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Pull requests that have been approved changes-requested Pull requests with requested changes enhancement Pull requests that make enhancements, instead of just purely new features future-was-2-years-ago Pull requests that introduce technologies which should have been "long" ago ready-to-merge Pull requests that have been approved and are ready to be merged
Projects
None yet
3 participants