-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathApp.js
192 lines (177 loc) · 6.19 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
import React, { Component } from 'react';
import { StyleSheet, Text, View, ScrollView } from 'react-native';
import Icon from 'react-native-vector-icons/FontAwesome';
import { FlatHeader, Group } from './components/header'; // use this when install from npm > 'react-native-flat-header';
export default class App extends Component {
render() {
return (
<View style={styles.container}>
<ScrollView>
<FlatHeader
leftIcon={<Icon name="rocket" size={30} color="#FFF" />}
leftIconHandler={() => {
console.warn('Icon Pressed');
}}
leftText="launch the rocket"
leftTextHandler={() => {
console.warn('Text Pressed');
}}
large
/>
<FlatHeader
leftIcon={<Icon name="rocket" size={30} color="#FFF" />}
leftIconHandler={() => {
console.warn('Left Icon Pressed');
}}
rightIcon={<Icon name="heart" size={30} color="#FFC107" />}
rightIconHandler={() => {
console.warn('Right Icon Pressed');
}}
leftText="launch the rocket"
leftTextHandler={() => {
console.warn('Text Pressed');
}}
large
style={{ backgroundColor: '#BA68C8' }}
/>
<FlatHeader
leftIcon={<Icon name="rocket" size={30} color="#FFF" />}
leftIconHandler={() => {
console.warn('Left Icon Pressed');
}}
leftText="launch the rocket"
leftTextHandler={() => {
console.warn('Left Text Pressed');
}}
rightIcon={<Icon name="heart" size={30} color="#FFC107" />}
rightIconHandler={() => {
console.warn('Right Text Pressed');
}}
rightText="Heart"
rightTextHandler={() => {
console.warn('Right Icon Pressed');
}}
style={{ backgroundColor: '#00BCD4' }}
/>
<FlatHeader
leftIcon={<Icon name="rocket" size={30} color="#FFF" />}
leftText="Left content"
leftContentHandler={() => {
console.warn('Left Content Pressed');
}}
rightIcon={<Icon name="heart" size={30} color="#FFC107" />}
rightText="Right content"
rightContentHandler={() => {
console.warn('Right Content Pressed');
}}
style={{ backgroundColor: '#C2185B' }}
/>
<FlatHeader
leftText="launch the rocket"
leftTextHandler={() => {
console.warn('Text Pressed');
}}
style={{ backgroundColor: '#81C784' }}
/>
<FlatHeader
rightText="launch the rocket"
rightTextHandler={() => {
console.warn('Right text Pressed');
}}
style={{ backgroundColor: '#558B2F' }}
/>
<FlatHeader
leftIcon={<Icon name="rocket" size={30} color="#FFF" />}
leftIconHandler={() => {
console.warn('Icon Pressed');
}}
style={{ backgroundColor: '#e57373' }}
/>
<FlatHeader
rightIcon={<Icon name="rocket" size={30} color="#FFF" />}
style={{ backgroundColor: '#D84315' }}
/>
<FlatHeader
leftIcon={<Icon name="rocket" size={30} color="#FFF" />}
leftIconHandler={() => {
console.warn('Icon Pressed');
}}
leftText="launch the rocket"
leftTextHandler={() => {
console.warn('Text Pressed');
}}
large
style={{ backgroundColor: '#7986CB' }}
>
<Text style={{ marginLeft: 10, color: 'yellow' }}>
Extra content
</Text>
</FlatHeader>
<FlatHeader
centerContent={<Text style={{ color: '#FFF' }}>Report</Text>}
style={{ backgroundColor: '#ff1744' }}
/>
<FlatHeader
leftIcon={<Icon name="rocket" size={30} color="#FFF" />}
centerContent={<Text style={{ color: '#FFF' }}>FAQ</Text>}
rightIcon={<Icon name="heart" size={30} color="#FFC107" />}
style={{ backgroundColor: '#29B6F6' }}
/>
<FlatHeader
leftIcon={<Icon name="arrow-left" size={30} color="#FFF" />}
leftText="back"
leftContentHandler={() => {
console.warn('Left both icon and text pressed');
}}
centerContent={
<Group>
<Icon name="comment" size={30} color="#FFF" />
<Text style={{ color: '#FFF', paddingHorizontal: 5 }}>FAQ</Text>
</Group>
}
rightIcon={<Icon name="star" size={30} color="#FFF" />}
style={{ backgroundColor: '#1A237E' }}
/>
<FlatHeader
leftIcon={<Icon name="arrow-left" size={30} color="#FFF" />}
leftText="back"
leftTextStyle={{ color: 'yellow' }}
leftContentHandler={() => {
console.warn('Left both icon and text pressed-Left Content');
}}
centerContent={
<Group>
<Icon name="comment" size={30} color="#FFF" />
<Text style={{ color: '#FFF', paddingHorizontal: 5 }}>FAQ</Text>
</Group>
}
centerContentHandler={() => console.warn('center content pressed')}
rightIcon={<Icon name="star" size={30} color="#FFF" />}
rightText="Favorite"
rightTextStyle={{ color: 'yellow' }}
rightContentHandler={() => {
console.warn('right both icon and text pressed-Right Content');
}}
style={{ backgroundColor: '#6200EA' }}
/>
</ScrollView>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#F5FCFF'
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5
}
});