-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
57 lines (53 loc) · 1.71 KB
/
App.js
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import React from 'react';
import {NavigationContainer} from '@react-navigation/native';
import {createNativeStackNavigator} from '@react-navigation/native-stack';
import MMKVStorage from 'react-native-mmkv-storage';
import HomeScreen from './src/screens/Home';
import JournalScreen from './src/screens/Journal';
import PageScreen from './src/screens/Page';
import {ThemeProvider} from 'styled-components/native';
import {CantoThemes} from './src/styles';
import {metadata} from './src';
const Stack = createNativeStackNavigator();
const App = () => {
const MMKV = new MMKVStorage.Loader()
.withInstanceID(metadata.mmkvInstance)
.initialize();
const theme = MMKV.getMap('theme') ?? {name: 'main'};
console.log(
`\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
CANTO DEBUG\n-----------------------------------
Theme: ${theme.name}
Time: ${new Date().toLocaleString()}\n\n`,
);
return (
<ThemeProvider theme={CantoThemes[theme.name]}>
<NavigationContainer>
<Stack.Navigator initialRouteName="Home">
<Stack.Screen
name="Home"
component={HomeScreen}
options={{headerShown: false}}
/>
<Stack.Screen
name="Journal"
component={JournalScreen}
options={{
headerStyle: {
backgroundColor: theme.headerBg,
color: theme.textColor,
},
headerTintColor: theme.textColor,
}}
/>
<Stack.Screen
name="Page"
component={PageScreen}
options={{headerShown: false}}
/>
</Stack.Navigator>
</NavigationContainer>
</ThemeProvider>
);
};
export default App;