This repository has been archived by the owner on Feb 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
App.tsx
52 lines (45 loc) · 1.97 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
import React from 'react'
import { Provider, MD3LightTheme } from 'react-native-paper'
import { NavigationContainer, createNavigationContainerRef } from '@react-navigation/native'
import { createNativeStackNavigator } from '@react-navigation/native-stack'
import LoginPhoneScreen from './src/screens/login/phone'
import LoginCodeScreen from './src/screens/login/code'
import MyTelegramLoginCodeScreen from './src/screens/login/myTelegramOrgCode'
import ManualTokensInput from './src/screens/login/manualTokensInput'
import SearchingTokensScreen from './src/screens/login/searchingTokens'
import Login2faScreen from './src/screens/login/twofa'
import FeedScreen from './src/screens/feed'
import * as SplashScreen from 'expo-splash-screen'
import { MessageRealmContext } from './src/models/index'
import { Button } from 'react-native'
SplashScreen.preventAutoHideAsync()
const Stack = createNativeStackNavigator()
const navigationRef = createNavigationContainerRef()
export default function App() {
return (
<MessageRealmContext.RealmProvider>
<Main />
</MessageRealmContext.RealmProvider>
)
}
function Main() {
const realm = MessageRealmContext.useRealm()
React.useEffect(() => {
global.realm = realm
}, [realm])
return (
<Provider theme={MD3LightTheme}>
<NavigationContainer ref={navigationRef}>
<Stack.Navigator screenOptions={{ headerShown: false }} >
<Stack.Screen name='LoginPhone' component={LoginPhoneScreen} />
<Stack.Screen name='MyTelegramLoginCode' component={MyTelegramLoginCodeScreen} />
<Stack.Screen name='SearchingTokens' component={SearchingTokensScreen} />
<Stack.Screen name='ManualTokensInput' component={ManualTokensInput} />
<Stack.Screen name='LoginCode' component={LoginCodeScreen} />
<Stack.Screen name='TwoFA' component={Login2faScreen} />
<Stack.Screen name='Feed' component={FeedScreen} />
</Stack.Navigator>
</NavigationContainer>
</Provider>
)
}