[Coming Soon...] | Ignite your creative idea with Hydrogen and start off with a BANG. Hydrogen builds a framework with tools and services that does the redundant work for you.
As is, the user is not able to change the theme. This feature is blocked as there is a code design flaw. The flaw is that we currently use a static theme referenced in file.
Design
useTheme
The React Native Paper Provider needs to receive theme by evaluating the state (e.g. useDarkTheme)
Moreover, when needing to access the theme directly, use useTheme hook and specifically from ./app/theme or react-native-paper. This enable us to use the Provider so if the value of theme changes we can respond.
Clarify colors, palette, and theme
Terms
Colors = common color names paired with their corresponding hex values. Basically just a map
Palette = a collection of colors. This is where we'll find things like primary and accent etc. The purpose of this is to enable various palettes like DarkMaterial or LightInitiativeTree or simply LightPalette and DarkPalette
Theme = a collection of colors + palette + spacing + fonts
colors is being referenced in so many styles which does not have access to Provider context
Navigation Theme should be dynamically mapped
Instead of a static file (e.g. app/theme/navigation) we should use a mapping method within the given UI library mapper (e.g. app/paper/theme.ts) where a method like the following exists to map between the UI Library's theming approach to the Navigation
As mentioned previously, styles.ts files are referencing theme for colors. The components and screens should be using the theme from useTheme or simply letting the components access the theme via the Provider. React Native Paper components will automatically receive changes to the theme.
Storybook theming is not in regular themes
The originally boilerplate has Storybook specific properties. We should either put this in a single file or leverage configurations for theme controls in Storybook
Problem
As is, the user is not able to change the theme. This feature is blocked as there is a code design flaw. The flaw is that we currently use a static theme referenced in file.
Design
useTheme
The React Native Paper
Provider
needs to receivetheme
by evaluating the state (e.g.useDarkTheme
)Moreover, when needing to access the theme directly, use
useTheme
hook and specifically from./app/theme
orreact-native-paper
. This enable us to use the Provider so if the value oftheme
changes we can respond.Clarify
colors
,palette
, andtheme
Terms
primary
andaccent
etc. The purpose of this is to enable various palettes likeDarkMaterial
orLightInitiativeTree
or simplyLightPalette
andDarkPalette
Remove Colors
from the repositoryColors should refer to a specific nearly unchanging list of colors (e.g. https://github.com/callstack/react-native-paper/blob/main/src/styles/colors.tsx). We don't need
colors
and should remove it.colors
is being referenced in so manystyles
which does not have access to Provider contextNavigation Theme should be dynamically mapped
Instead of a static file (e.g.
app/theme/navigation
) we should use a mapping method within the given UI library mapper (e.g.app/paper/theme.ts
) where a method like the following exists to map between the UI Library's theming approach to the NavigationFor example
Do not use
theme
withinStyles
As mentioned previously,
styles.ts
files are referencingtheme
for colors. The components and screens should be using the theme fromuseTheme
or simply letting the components access the theme via the Provider. React Native Paper components will automatically receive changes to the theme.Storybook theming is not in regular themes
The originally boilerplate has Storybook specific properties. We should either put this in a single file or leverage configurations for theme controls in Storybook