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
Put the toggle theme button in the header and serialize the prefered theme value to localStorage with hook #1641
Comments
Would love to hear about more about this, I don't know anything about |
See https://github.com/streamich/react-use/blob/master/docs/useLocalStorage.md Browsers have a number of built-in "storage" areas:
For something like a preference for dark vs. light mode, local storage is perfect. You would use it vs. state via a hook, and set it (i.e., set it in the db) when the user changes it, and read it from the db on startup. |
@chrispinkney : Want to take this on Chris now that we have the header in? |
@tonyvugithub I'd like to but I think I have too much on my plate right now, I'll make a reminder to re-evaluate this later in the week but if anyone reading this wants this feel free to jump on it. |
@chrispinkney i can take it |
I think it's better to detect the system setting of the device first and set the dark/light theme automatically, and still have a switcher for user to change to their desired theme mode |
I agree using |
What would you like to be added:
We need to think of a better way to integrate the theme switching option. Maybe a switch button in the header? Also we need to think of a way to retain the chosen theme so when users revisit the site, the same colors appear to them.
Why would you like this to be added:
This will provide users option to choose their preferred theme and increase their engagement to the app.
Reference for dark theme can be found #1637
The text was updated successfully, but these errors were encountered: