-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFlagStatus.js
106 lines (100 loc) · 2.35 KB
/
FlagStatus.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
import React, { Component } from 'react';
import { Text, View, StyleSheet, Image, ScrollView } from 'react-native';
class FlagStatus extends Component {
static navigationOptions = {
title: 'Honor The Flag',
headerStyle: {
backgroundColor: '#4169e1',
height: 40,
},
headerForceInset: { top: 'never', bottom: 'never' },
headerTintColor: '#FFFFFF',
};
_getFlagIcon() {
return (
<View>
<Image
resizeMode={'contain'}
style={{ width: 50, height: 50 }}
source={{
uri: 'https://static.thenounproject.com/png/167147-200.png'
}}
/>
</View>
);
}
render() {
const { navigation } = this.props;
const data = navigation.getParam('item', {});
return (
<View style={styles.page}>
<ScrollView>
<View style={styles.contentContainer}>
<View style={styles.headerContainer}>
{this._getFlagIcon()}
<Text style={styles.alertHeader}>
HALF STAFF ALERT
</Text>
</View>
<Text style={styles.title}>{data.short}</Text>
<Text style={styles.date}>
<Text>{"From " + data.start + " until " + data.end}</Text>
</Text>
{data.long.split('<br/>').map((line, i) => (
<Text style={styles.line} key={i}>
{line}
</Text>
))}
</View>
</ScrollView>
</View>
);
}
}
const styles = StyleSheet.create({
page: {
backgroundColor: 'white',
flex: 1,
},
contentContainer: {
flex: 1,
justifyContent: "center",
alignItems: "center",
padding: 14,
backgroundColor: 'white',
margin: 3,
borderRadius: 2,
},
headerContainer: {
flex: 1,
justifyContent: 'center',
alignItems: "center",
backgroundColor: 'white',
alignSelf: 'stretch',
flexDirection: 'row',
padding: 4,
borderColor: 'crimson',
borderWidth: 1,
},
alertHeader: {
fontSize: 24,
padding: 6,
//fontFamily: 'sans-serif-condensed',
},
date: {
fontSize: 18,
fontWeight: '800',
paddingTop: 12,
paddingBottom: 12,
//fontFamily: 'sans-serif-condensed',
},
title: {
fontSize: 24,
fontWeight: '800',
paddingTop: 24,
//fontFamily: 'sans-serif-condensed',
},
line: {
},
});
export default FlagStatus;