MCPcopy Create free account
hub / github.com/callstack/react-native-paper / adaptNavigationTheme

Function adaptNavigationTheme

src/core/theming.tsx:90–114  ·  view source on GitHub ↗
(themes: any)

Source from the content-addressed store, hash-verified

88}): { LightTheme: TLight; DarkTheme: TDark };
89// eslint-disable-next-line no-redeclare
90export function adaptNavigationTheme(themes: any) {
91 const {
92 reactNavigationLight,
93 reactNavigationDark,
94 materialLight,
95 materialDark,
96 } = themes;
97
98 const MD3Themes = {
99 light: materialLight || MD3LightTheme,
100 dark: materialDark || MD3DarkTheme,
101 };
102
103 const result: { LightTheme?: any; DarkTheme?: any } = {};
104
105 if (reactNavigationLight) {
106 result.LightTheme = getAdaptedTheme(reactNavigationLight, MD3Themes.light);
107 }
108
109 if (reactNavigationDark) {
110 result.DarkTheme = getAdaptedTheme(reactNavigationDark, MD3Themes.dark);
111 }
112
113 return result;
114}
115
116const getAdaptedTheme = <T extends NavigationTheme>(
117 theme: T,

Callers 2

theming.test.tsxFile · 0.90
themes.tsFile · 0.85

Calls 1

getAdaptedThemeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…