forked from fleetbase/storefront-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
50 lines (45 loc) · 1.59 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
/**
* Storefront Ecommerce for On-Demand
*
* @format
* @flow strict-local
*/
import 'react-native-gesture-handler';
import React from 'react';
import type { Node } from 'react';
import { Platform, Text, View, ActivityIndicator } from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator, TransitionPresets } from '@react-navigation/stack';
import CoreStack from './src/features/Core/CoreStack';
import { config } from './src/utils';
import tailwind from 'tailwind';
const isAndroid = Platform.OS === 'android';
const Stack = createStackNavigator();
const linking = {
prefixes: [config('APP_LINK_PREFIX'), ...config('app.linkingPrefixes')].filter(Boolean),
config: {
screens: {
StoreScreen: 'store/:id',
},
},
};
const App: () => Node = () => {
return (
<NavigationContainer
linking={linking}
fallback={
<View style={tailwind('bg-white flex items-center justify-center w-full h-full')}>
<View style={tailwind('flex items-center justify-center')}>
<ActivityIndicator style={tailwind('mb-4')} />
<Text style={tailwind('text-gray-700')}>Loading...</Text>
</View>
</View>
}
>
<Stack.Navigator>
<Stack.Screen name="CoreStack" component={CoreStack} options={{ headerShown: false, animationEnabled: false, gestureEnabled: false }} />
</Stack.Navigator>
</NavigationContainer>
);
};
export default App;