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

app: theme switcher #4211

Merged
merged 12 commits into from
Nov 24, 2024
Merged

app: theme switcher #4211

merged 12 commits into from
Nov 24, 2024

Conversation

jamesacklin
Copy link
Member

@jamesacklin jamesacklin commented Nov 20, 2024

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 or dark 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 upon useIsDarkMode() 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

@jamesacklin
Copy link
Member Author

jamesacklin commented Nov 21, 2024

Added a "Peony" theme as well.

Preview

Copy link
Contributor

@dnbrwstr dnbrwstr left a 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.

packages/app/provider/index.tsx Show resolved Hide resolved
@jamesacklin jamesacklin merged commit 403f5eb into develop Nov 24, 2024
1 check passed
@jamesacklin jamesacklin deleted the ja/theme-switcher branch November 24, 2024 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants