-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
52 lines (46 loc) · 1.58 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
import React from 'react';
import 'react-native-gesture-handler';
import {createAppContainer} from 'react-navigation';
import {createStackNavigator} from 'react-navigation-stack';
import {Root} from 'native-base';
import AsyncStorage from '@react-native-community/async-storage';
import Main from './src/screens/Main';
import LibraryDetails from './src/screens/Library/Components/LibraryDetails';
import Library from './src/screens/Library';
import Camera from './src/screens/Camera';
import Intro from './src/screens/Intro';
import Setting from './src/screens/Settings';
import FAQ from './src/screens/Settings/components/FAQ';
import PrivacyPolicy from './src/screens/Settings/components/PrivacyPolicy';
import Terms from './src/screens/Settings/components/Terms';
import Result from './src/screens/Result';
const firstTime = async () => {
return (await AsyncStorage.getItem('@finish_intro')) === true; // improvement: could have use redux
};
export default (props) => {
const RootStack = createStackNavigator(
{
Main: {screen: Main},
Library: {screen: Library},
LibraryDetails: {screen: LibraryDetails},
Camera: {screen: Camera},
Intro: {screen: Intro},
Setting: {screen: Setting},
FAQ: {screen: FAQ},
PrivacyPolicy: {screen: PrivacyPolicy},
Terms: {screen: Terms},
Result: {screen: Result},
},
{
index: 0,
initialRouteName: !firstTime() ? 'Library' : 'Intro',
headerMode: 'none',
},
);
const AppContainer = createAppContainer(RootStack);
return (
<Root>
<AppContainer />
</Root>
);
};