-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnavigationapp.js
executable file
·104 lines (89 loc) · 2.76 KB
/
navigationapp.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
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
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
* @flow strict-local
*/
import React from 'react';
//import * as React from 'react';
import { SignUp,
Wallet,
Backup,
Recieve,
Send,
Import,
Item,
Breed,
Loading } from "./screens";
import { createStackNavigator } from "@react-navigation/stack";
import { NavigationContainer, DefaultTheme } from '@react-navigation/native';
import SystemNavigationBar from 'react-native-system-navigation-bar';
import Tabs from "./navigation/tabs";
import store from "./store";
import {useStoreState} from "./hooks/storeHooks"
const theme = {
...DefaultTheme,
colors: {
...DefaultTheme.colors,
border: "transparent",
},
};
import FlashMessage, {showMessage,} from "react-native-flash-message";
import { useStoreRehydrated } from "easy-peasy";
const Stack = createStackNavigator();
const NavigationApp = () => {
const isRehydrated = useStoreRehydrated();
SystemNavigationBar.navigationHide();
const hasWallet = useStoreState((state) => state.hasWallet);
if ( !isRehydrated )
return (
<NavigationContainer theme={theme}>
<Stack.Navigator
screenOptions={{
headerShown: false
}}
initialRouteName={'Loading'}
>
<Stack.Screen name="Loading" component={Loading} options={{ headerShown: false }} />
</Stack.Navigator>
</NavigationContainer>
);
if (hasWallet) {
return (
<>
<NavigationContainer theme={theme}>
<Stack.Navigator
screenOptions={{
headerShown: false,
tabBarVisible:false,
}}
initialRouteName={'Home'}
>
<Stack.Screen name="Tabs" component={Tabs} />
<Stack.Screen name="Backup" component={Backup} />
<Stack.Screen name="Import" component={Import} />
<Stack.Screen name="Breed" component={Breed} />
<Stack.Screen name="Recieve" component={Recieve} />
<Stack.Screen name="Send" component={Send} />
<Stack.Screen name="Item" component={Item} />
</Stack.Navigator>
</NavigationContainer>
</>
)
}else {
return (
<NavigationContainer theme={theme}>
<Stack.Navigator
screenOptions={{
headerShown: false
}}
initialRouteName={'SignUp'}
>
<Stack.Screen name="SignUp" component={SignUp} options={{ headerShown: false }} />
</Stack.Navigator>
</NavigationContainer>
);
}
}
export default NavigationApp;