-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
49 lines (44 loc) · 1.63 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
import React from 'react';
import MyDrawer from './MyDrawers';
import LottieView from 'lottie-react-native';
import {Platform , View} from 'react-native';
import { createStackNavigator, CardStyleInterpolators } from '@react-navigation/stack';
import { NavigationContainer } from '@react-navigation/native';
export default function App() {
const Stack = createStackNavigator ();
return (
<View style={{flex:1, backgroundColor: '#2C4365',position:'absolute',top:0,bottom:0,left:0,right:0}}>
<NavigationContainer>
<Stack.Navigator screenOptions={{
presentation: 'modal',
headerShown: false,
cardStyleInterpolator: CardStyleInterpolators.forBottomSheetAndroid
}}>
<Stack.Screen name="Slash" component={Slash} />
<Stack.Screen name="MyDrawer" component={MyDrawer} />
</Stack.Navigator>
</NavigationContainer>
</View>
);
}
const Slash = ({navigation}) => {
//check if react-native is open in browser
if(Platform.OS === 'web'){
navigation.replace('MyDrawer')
return (
<View style={{position:'absolute',top:0,bottom:0,left:0,right:0,backgroundColor:'#2C4365',justifyContent:'center',alignItems:'center'}}>
</View>
)
}
return(
<View style={{position:'absolute',top:0,bottom:0,left:0,right:0,backgroundColor:'#2C4365',justifyContent:'center',alignItems:'center'}}>
<LottieView
style={{height:100,width:100}}
source={require('./assets/animation_kvh2r8kk.json')}
autoPlay
loop={false}
onAnimationFinish={()=>{navigation.replace('MyDrawer')}}
/>
</View>
)
}