-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathApp.js
68 lines (60 loc) · 1.43 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
import React, { Component } from "react";
import { View, Text, StyleSheet } from "react-native";
import AnimatedMultistep from "./lib";
import Step1 from "./steps/step1";
import Step2 from "./steps/step2";
import Step3 from "./steps/step3";
import Step4 from "./steps/step4";
const allSteps = [
{ name: "step 1", component: Step1 },
{ name: "step 2", component: Step2 },
{ name: "step 3", component: Step3 },
{ name: "step 4", component: Step4 }
];
export default class App extends Component {
constructor(props) {
super(props);
this.state = {};
}
onNext = () => {
console.log("Next");
};
onBack = () => {
console.log("Back");
};
finish = state => {
console.log("TCL: App -> state", state);
};
render() {
return (
<View style={{ flex: 1, backgroundColor: "#1dd1a1" }}>
<View style={styles.upperContainer}>
<Text style={styles.loginText}>Register</Text>
</View>
<View style={styles.lowerContainer}>
<AnimatedMultistep
steps={allSteps}
onFinish={this.finish}
animate={true}
onBack={this.onBack}
onNext={this.onNext}
/>
</View>
</View>
);
}
}
const styles = StyleSheet.create({
upperContainer: {
flex: 1,
justifyContent: "flex-end",
alignItems: "center"
},
loginText: {
fontSize: 32,
color: "#fff"
},
lowerContainer: {
flex: 2
}
});