Skip to content
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: add adaptNavigationTheme utility #3399

Merged
merged 1 commit into from
Oct 18, 2022

Conversation

lukewalczak
Copy link
Member

@lukewalczak lukewalczak commented Oct 4, 2022

Summary

PR introduces an adaptNavigationTheme utility function returning provided React Navigation compliant theme, adapted in terms of colors, to the Material Design 3 color system.

  • - update doc related to theming with react navigation

Related issues:

Example

import { NavigationContainer, DefaultTheme } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import { Provider, MD3LightTheme, adaptNavigationTheme } from 'react-native-paper';
const Stack = createStackNavigator();
const { LightTheme } = adaptNavigationTheme({ lightTheme: DefaultTheme });
export default function App() {
  return (
    <Provider theme={MD3LightTheme}>
      <NavigationContainer theme={LightTheme}>
        <Stack.Navigator initialRouteName="Home">
          <Stack.Screen name="Home" component={HomeScreen} />
          <Stack.Screen name="Details" component={DetailsScreen} />
        </Stack.Navigator>
      </NavigationContainer>
    </Provider>
  );
}

Test plan

New functionality is covered by unit tests.

@github-actions
Copy link

github-actions bot commented Oct 4, 2022

The mobile version of example app from this branch is ready! You can see it here

.

@callstack-bot
Copy link

callstack-bot commented Oct 5, 2022

Hey @lukewalczak, thank you for your pull request 🤗. The documentation from this branch can be viewed here.

@github-actions
Copy link

github-actions bot commented Oct 5, 2022

The mobile version of example app from this branch is ready! You can see it here

.

@lukewalczak lukewalczak force-pushed the feat/create-navigation-theme-adapter branch from a1546fe to ef74b0d Compare October 5, 2022 12:52
@github-actions
Copy link

github-actions bot commented Oct 5, 2022

The mobile version of example app from this branch is ready! You can see it here

.

docs/pages/2.theming.md Outdated Show resolved Hide resolved
src/core/theming.tsx Outdated Show resolved Hide resolved
docs/pages/8.theming-with-react-navigation.md Outdated Show resolved Hide resolved
docs/pages/2.theming.md Outdated Show resolved Hide resolved
docs/pages/2.theming.md Outdated Show resolved Hide resolved
@github-actions
Copy link

The mobile version of example app from this branch is ready! You can see it here

.

@lukewalczak lukewalczak requested a review from satya164 October 15, 2022 18:20
@lukewalczak lukewalczak force-pushed the feat/create-navigation-theme-adapter branch from fbecdb3 to 3b96d8f Compare October 17, 2022 11:58
@lukewalczak lukewalczak force-pushed the feat/create-navigation-theme-adapter branch from 3b96d8f to e1ae723 Compare October 17, 2022 12:36
@github-actions
Copy link

The mobile version of example app from this branch is ready! You can see it here

.

@lukewalczak lukewalczak merged commit 57e78bd into main Oct 18, 2022
@lukewalczak lukewalczak deleted the feat/create-navigation-theme-adapter branch October 18, 2022 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants