-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
feat: handle theme change based on preferences #2016
Conversation
The mobile version of example app from this branch is ready! You can see it here |
src/core/Provider.tsx
Outdated
} else { | ||
const theme = | ||
this.state.colorScheme === 'light' ? DefaultTheme : DarkTheme; | ||
return Object.assign(theme as ReactNativePaper.Theme, { |
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.
Probably not from your change, but Object.assign
incorrect here since:
- It'll mutate our theme
- Adding
animation
property will override anything else defined in this property. We don't have anything else right now, but might have in future.
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.
36791a5
to
de8c2ec
Compare
a627ee3
to
58ab6a0
Compare
Motivation
Closes #1597
Android 10 and iOS 13 added support for dark theme. User (like me ;p) can set dark theme as default theme. Application should adapt to this theme automatically, hence I would like to have automatically theme changing in my app, so I don't need to care about user preferences.
TODO
Screenshots
Test plan