-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
32 lines (28 loc) · 1.05 KB
/
App.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import 'react-native-image-keyboard';
import { StatusBar } from 'expo-status-bar';
import { MD3DarkTheme, MD3LightTheme, PaperProvider } from 'react-native-paper';
import Main from './src';
import { Toaster } from 'burnt/web';
import { useColorScheme } from 'react-native';
import { useMaterial3Theme } from '@pchmn/expo-material3-theme';
import { useEffect, useMemo } from 'react';
const App = () => {
const colorScheme = useColorScheme();
// If the device is not compatible, it will return a theme based on the fallback source color (optional, default to #6750A4)
const { theme, updateTheme } = useMaterial3Theme({ fallbackSourceColor: '#3E8260' });
const paperTheme = useMemo(
() =>
colorScheme === 'dark'
? { ...MD3DarkTheme, colors: theme.dark }
: { ...MD3LightTheme, colors: theme.light },
[colorScheme, theme],
);
return (
<PaperProvider theme={paperTheme}>
<Main updateTheme={updateTheme} />
<StatusBar style="auto" />
<Toaster position="bottom-right" />
</PaperProvider>
);
};
export default App;