question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

replace adaptNavigationTheme with getAdaptedTheme

See original GitHub issue

Is 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:closed
  • Created 10 months ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
lukewalczakcommented, Nov 21, 2022

Hey @davisk4rpi, thanks for the feedback, I see your point. I will try to refactor the utility to consider the presented case.

0reactions
lukewalczakcommented, Nov 29, 2022

Hey @davisk4rpi, I’ve raised the PR with the final approach which:

  • extends adaptNavigationThemes by two new (optional) themes object properties: materialLight and materialDarkwhere you can pass your custom theme compliant with MD and Paper.
  • existing properties light and dark were renamed to reactNavigationLight and reactNavigationDark

Hopefully, that approach also fits for your use case!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found