-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
91 lines (81 loc) · 1.97 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
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
import React from 'react';
import LottieView from 'lottie-react-native';
import { StyleSheet, Text, View, Button, Image, ImageBackground } from 'react-native';
import { createStackNavigator } from 'react-navigation';
class HomeScreen extends React.Component {
render() {
setInterval(() => {
this.props.navigation.navigate('Presentation');
}, 5000);
return (
<ImageBackground style={styles.containerSplash} source={require('./assets/fondo.png')}>
<Image source={require('./assets/Group.png')}>
</Image>
</ImageBackground>
);
}
}
class PresentationScreen extends React.Component {
componentDidMount() {
this.animation.play();
// Or set a specific startFrame and endFrame with:
this.animation.play(30, 120);
}
render() {
return (
<View style={{ flex: 1 }}>
<LottieView
ref={animation => {
this.animation = animation;
}}
source={require('./assets/servishero_loading.json')}
/>
<Button
title="Nuevo Xpense"
onPress={() => this.props.navigation.navigate('User')}
/>
</View>
);
}
}
class UserScreen extends React.Component {
render() {
return (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<Text>User Screen</Text>
<Button
title="Go back"
onPress={() => this.props.navigation.goBack()}
/>
</View>
);
}
}
const RootStack = createStackNavigator(
{
Home: HomeScreen,
Presentation: PresentationScreen,
User: UserScreen,
},
{
initialRouteName: 'Home',
}
);
export default class App extends React.Component {
render() {
return <RootStack />;
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
containerSplash: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
},
});