-
Notifications
You must be signed in to change notification settings - Fork 25
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
app: theme switcher #4211
Merged
Merged
app: theme switcher #4211
+378
−94
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…emeContext provider, handle system theme changes, store theme selection in AsyncStorage
jamesacklin
requested review from
dnbrwstr,
patosullivan,
davidisaaclee,
arthyn and
latter-bolden
November 20, 2024 20:43
dnbrwstr
approved these changes
Nov 21, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple nits, but I think this is great, and I'm all for merging. Light/dark/auto is strictly an improvement, the ui is helpful for debugging, and it really doesn't add any more complexity than we're already managing.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Super-extra fun, absolutely not essential or time-sensitive.
Adds a theme switcher to the app and provides a set of base16 themes.
Wraps TamaguiProvider with a ThemeContext provider with hooks to set and clear the theme. The user's theme selection is stored in AsyncStorage. We use either
light
ordark
based on the user's device theme selection if they set to "auto" (default behavior). The themes themselves do not encode any kind of 'lightness' or 'darkness,' so if we are calling uponuseIsDarkMode()
anywhere in the app, we might see some odd color choices.Also touches up a couple places that were non-reactive to theme changes and got placeholderTextColor working in BareChatInput.
Video demo: https://s3.rilfun-lidlen.startram.io/bucket/rilfun-lidlen/2024.11.20..20.41.48..7a5e.353f.7ced.9168-Simulator-Screen-Recording---iPhone-16---2024-11-20-at-15.38.26.mp4