-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathScreens.js
65 lines (62 loc) · 1.89 KB
/
Screens.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
import React, { Component } from 'react';
import {
StyleSheet, // CSS-like styles
Text, // Renders text
View // Container component
} from 'react-native';
import Icon from 'react-native-vector-icons/Ionicons';
import Swiper from './Swiper';
export default class Screens extends Component {
render() {
return (
<Swiper>
{/* First screen */}
<View style={[styles.slide, { backgroundColor: '#C04DEE' }]}>
<Icon name="ios-nutrition" {...iconStyles} />
<Text style={styles.header}>EAT</Text>
<Text style={styles.text}>Good nutrition is an important part of leading a healthy lifestyle</Text>
</View>
{/* Second screen */}
<View style={[styles.slide, { backgroundColor: '#4AAFEE' }]}>
<Icon name="ios-cloud-upload" {...iconStyles} />
<Text style={styles.header}>PRAY</Text>
<Text style={styles.text}>Prayer is one of the most important things a Christian can do</Text>
</View>
{/* Third screen */}
<View style={[styles.slide, { backgroundColor: '#FC515B' }]}>
<Icon name="ios-heart" {...iconStyles} />
<Text style={styles.header}>LOVE</Text>
<Text style={styles.text}>Where there is love there is life</Text>
</View>
</Swiper>
);
}
}
const iconStyles = {
size: 100,
color: '#FFFFFF',
};
const styles = StyleSheet.create({
// Slide styles
slide: {
flex: 1, // Take up all screen
justifyContent: 'center', // Center vertically
alignItems: 'center', // Center horizontally
},
// Header styles
header: {
color: '#FFFFFF',
fontFamily: 'Avenir',
fontSize: 30,
fontWeight: 'bold',
marginVertical: 15,
},
// Text below header
text: {
color: '#FFFFFF',
fontFamily: 'Avenir',
fontSize: 18,
marginHorizontal: 40,
textAlign: 'center',
},
});