-
Notifications
You must be signed in to change notification settings - Fork 149
/
Copy pathexample.jsx
75 lines (69 loc) · 2.04 KB
/
example.jsx
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
import { View, Text, StyleProp, ViewStyle } from 'react-native';
import { ProgressStep, ProgressSteps } from 'react-native-progress-steps';
export default function ExampleProgressSteps() {
const defaultScrollViewProps = {
keyboardShouldPersistTaps: 'handled',
contentContainerStyle: {
flexGrow: 1,
justifyContent: 'center',
},
};
const onPaymentStepComplete = () => {
console.log('payment step completed!');
};
const onNextStep = () => {
console.log('called next step');
};
const onPrevStep = () => {
console.log('called previous step');
};
const onSubmitSteps = () => {
console.log('called submit step');
};
return (
<View style={{ flex: 1 }}>
<ProgressSteps>
<ProgressStep
label='Payment'
onNext={onPaymentStepComplete}
onPrevious={onPrevStep}
scrollViewProps={defaultScrollViewProps}
>
<View style={{ alignItems: 'center' }}>
<Text>Payment step content</Text>
</View>
</ProgressStep>
<ProgressStep
label='Shipping Address'
onNext={onNextStep}
onPrevious={onPrevStep}
scrollViewProps={defaultScrollViewProps}
>
<View style={{ alignItems: 'center' }}>
<Text>Shipping address step content</Text>
</View>
</ProgressStep>
<ProgressStep
label='Billing Address'
onNext={onNextStep}
onPrevious={onPrevStep}
scrollViewProps={defaultScrollViewProps}
>
<View style={{ alignItems: 'center' }}>
<Text>Billing address step content</Text>
</View>
</ProgressStep>
<ProgressStep
label='Confirm Order'
onPrevious={onPrevStep}
onSubmit={onSubmitSteps}
scrollViewProps={defaultScrollViewProps}
>
<View style={{ alignItems: 'center' }}>
<Text>Confirm order step content</Text>
</View>
</ProgressStep>
</ProgressSteps>
</View>
);
}