-
Notifications
You must be signed in to change notification settings - Fork 2
/
App.tsx
109 lines (98 loc) · 2.9 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
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
import { DarkTheme, DefaultTheme, NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import React from 'react';
import type { PropsWithChildren } from 'react';
import {
StyleSheet,
Text,
useColorScheme,
View,
} from 'react-native';
import { useMaterial3Theme } from '@pchmn/expo-material3-theme';
import {
MD3DarkTheme,
MD3LightTheme,
PaperProvider,
adaptNavigationTheme,
} from 'react-native-paper';
import { Login } from './src/screens/Login';
import { Main as MainScreen } from './src/screens/Main';
import { Stack } from './src/globals/navigator';
import { Chat } from './src/screens/Chat';
import { ConnectToSatori } from './src/screens/connection/Satori';
import { initConfigStore } from './src/globals/config';
import { ConnectToDiscord } from './src/screens/connection/Discord';
import { initUseLogins } from './src/globals/satori';
import { Contact } from './src/screens/Contact';
import Test from './src/screens/Test';
import { ChannelSelect } from './src/screens/ChannelSelect';
import { Debug } from './src/screens/Debug';
import { Webview } from './src/screens/WebView';
const { LightTheme, DarkTheme: DarkThemeA } = adaptNavigationTheme({ reactNavigationLight: DefaultTheme, reactNavigationDark: DarkTheme });
function App(): React.JSX.Element {
const isDarkMode = useColorScheme() === 'dark';
return (
<NavigationContainer theme={isDarkMode ? DarkThemeA : LightTheme} >
<Stack.Navigator screenOptions={{
headerShown: false
}}>
<Stack.Screen
name="Main"
component={MainScreen}
/>
<Stack.Screen
name="Login"
component={Login}
/>
<Stack.Screen
name="Chat"
component={Chat}
/>
<Stack.Screen
name='Contact'
component={Contact}
/>
<Stack.Screen
name='Test'
component={Test}
/>
<Stack.Screen
name='Debug'
component={Debug}
/>
<Stack.Screen
name='ChannelSelect'
component={ChannelSelect}
/>
<Stack.Screen
name='Webview'
component={Webview}
/>
{/* Connect for adaptors */}
<Stack.Screen
name="ConnectToSatori"
component={ConnectToSatori}
/>
<Stack.Screen
name="ConnectToDiscord"
component={ConnectToDiscord}
/>
</Stack.Navigator>
</NavigationContainer>
);
}
export default function Main() {
const colorScheme = useColorScheme();
const { theme } = useMaterial3Theme();
initConfigStore();
initUseLogins()
const paperTheme =
colorScheme === 'dark'
? { ...MD3DarkTheme, colors: theme.dark }
: { ...MD3LightTheme, colors: theme.light };
return (
<PaperProvider theme={paperTheme}>
<App />
</PaperProvider>
);
}