-
Notifications
You must be signed in to change notification settings - Fork 26
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
Dark theme #212
Dark theme #212
Conversation
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.
I wrote some comments
About other problems, I think it should be ok to merge this theme as it now and add additional tasks to fix these bugs
Until then the dark theme may stay in beta
src/state/Context.tsx
Outdated
@@ -11,4 +11,15 @@ const cyclesInit: CyclesContextI = { | |||
updateCycles: (_newCycles) => {}, | |||
}; | |||
|
|||
interface ThemeContextI { |
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.
Usually interface name started with I, not ended
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.
Fixed
src/modals/Menu.tsx
Outdated
const { theme, updateTheme } = useContext(ThemeContext); | ||
|
||
const themesList = []; | ||
for (const item of ["basic", "dark"]) { |
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.
Call this theme dark(beta), because we have some problems with it for now
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.
Fixed
Closed #51
I added a dark theme. To do this, I rewrote the code a little to make it easier to continue adding new themes. It looks like this:
But I have a problem now. If the user has selected a dark theme and opens the application, then a highlight occurs, where the default theme (light) is first shown, then the dark one. I tried to fix this using
useLayoutEffect
, but it didn't work.Also, I couldn’t adapt the
ionSelector
to the dark theme (I couldn’t change the background)