-
Notifications
You must be signed in to change notification settings - Fork 1
/
onboarding.js
52 lines (48 loc) · 1.31 KB
/
onboarding.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
import {Text, View} from 'react-native';
import React, {Component} from 'react';
import { IndicatorViewPager, PagerDotIndicator} from 'rn-viewpager';
export default class Onboarding extends Component {
render() {
return (
<View style={styles.container}>
<IndicatorViewPager
style={styles.indicatorViewPager}
indicator={this._renderDotIndicator()}>
<View style={styles.firstView}>
<Text>page one</Text>
</View>
<View style={styles.secondView}>
<Text>page two</Text>
</View>
<View style={styles.thirdView}>
<Text>page three</Text>
</View>
</IndicatorViewPager>
</View>
);
}
_renderDotIndicator() {
return <PagerDotIndicator pageCount={3} />;
}
}
const cadetblue = 'cadetblue';
const cornflowerblue = 'cornflowerblue';
const green = '#1AA094';
const styles = StyleSheet.create({
container: {
flex: 1
},
indicatorViewPager: {
flex: 1,
flexDirection: 'column'
},
firstView: {
backgroundColor: cadetblue
},
secondView: {
backgroundColor: cornflowerblue
},
thirdView: {
backgroundColor: green
}
});