replace adaptNavigationTheme with getAdaptedTheme
See original GitHub issueIs your feature request related to a problem? Please describe.
adaptNavigationTheme
does not work with custom Material themes and the input/output interface feels clunky.
Describe the solution you’d like
within the function body of adaptNavigationTheme
, there is a getAdaptedTheme
function. If this were exposed instead of adaptNavigationTheme
we’d have a more flexible tool.
ex implementation:
export function getAdaptedNavigationTheme(navigationTheme: NavigationTheme, theme: MD3Theme): NavigationTheme {
return {
...navigationTheme,
colors: {
...navigationTheme.colors,
primary: theme.colors.primary,
background: theme.colors.background,
card: theme.colors.elevation.level2,
text: theme.colors.onSurface,
border: theme.colors.outline,
notification: theme.colors.error
}
};
};
Describe alternatives you’ve considered
add an optional param to adaptNavigationTheme
where you can provide custom light and dark MD3Themes
ex:
type OptionalMD3Theme = {
light: MD3LightTheme;
dark: MD3DarkTheme;
}
Additional context
version: 5.0.0-rc.10
Issue Analytics
- State:
- Created 10 months ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Theming with React Navigation · React Native Paper
However, to simplify adapting React Navigation theme colors, to use the ones from React Native Paper, it's worth using a utility called adaptNavigationTheme...
Read more >AdaptiveTheme | Drupal.org
Adaptivetheme for Drupal 8 is a base theme designed for people who don't code, or for those who only want to write a...
Read more >Adaptable theme - MoodleDocs
Make sure you have all the required versions. · Download and unpack the module. · Place the folder ("adaptable") in the "theme" subdirectory....
Read more >Change navigation theme color in GitLab - Stack Overflow
It can only changed for individual profile. As mentioned in this document of Gitlab,. Click your avatar icon in the top right corner,...
Read more >Introducing Collection of New Visual Studio Themes!
The Theme Converter is still in an experimental stage and we are working closely with the community to refine the new themes. If...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey @davisk4rpi, thanks for the feedback, I see your point. I will try to refactor the utility to consider the presented case.
Hey @davisk4rpi, I’ve raised the PR with the final approach which:
adaptNavigationThemes
by two new (optional) themes object properties:materialLight
andmaterialDark
where you can pass your custom theme compliant with MD and Paper.light
anddark
were renamed toreactNavigationLight
andreactNavigationDark
Hopefully, that approach also fits for your use case!