-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathStart.tsx
43 lines (40 loc) · 1.4 KB
/
Start.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
import { StyleSheet } from "react-native";
import { useEffect, useState } from "react";
import AEView from "./AEItemView";
import { createStackNavigator } from '@react-navigation/stack'
import { NavigationContainer } from "@react-navigation/native";
import * as SecureStore from 'expo-secure-store';
import Settings from "./Settings";
export default function StartNavigator() {
const Stack = createStackNavigator()
const [ready, setReady] = useState(null);
function isReady(): boolean {
let r = SecureStore.getItem('server.ip') != null && SecureStore.getItem('server.scheme') != null && SecureStore.getItem("user.uuid") != null
try {
r = r && JSON.parse(SecureStore.getItem("user.ae_main_net"))?.x != undefined
} catch (e) {
r = false;
}
return r;
}
return (
<NavigationContainer>
<Stack.Navigator initialRouteName={isReady() ? "Main" : "Start"}>
<Stack.Screen name='Start' component={Settings} />
<Stack.Screen name='Main' component={AEView} options={
{
headerShown: false
}
} />
</Stack.Navigator>
</NavigationContainer>
)
}
const styleSheet = StyleSheet.create({
outside: {
flexDirection: 'column'
},
horizontal: {
flexDirection: 'row'
}
});