|
@@ -0,0 +1,136 @@
|
|
1
|
+// @flow
|
|
2
|
+
|
|
3
|
+import * as React from 'react';
|
|
4
|
+import {FlatList, Image, View} from 'react-native';
|
|
5
|
+import {Card, List, Text, withTheme} from 'react-native-paper';
|
|
6
|
+import i18n from 'i18n-js';
|
|
7
|
+import {Linking} from "expo";
|
|
8
|
+
|
|
9
|
+type Props = {};
|
|
10
|
+
|
|
11
|
+type State = {};
|
|
12
|
+
|
|
13
|
+/**
|
|
14
|
+ * Class defining a planning event information page.
|
|
15
|
+ */
|
|
16
|
+class AmicaleContactScreen extends React.Component<Props, State> {
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+ CONTACT_DATASET = [
|
|
20
|
+ {
|
|
21
|
+ name: i18n.t("amicaleAbout.roles.interSchools"),
|
|
22
|
+ email: "inter.ecoles@amicale-insat.fr",
|
|
23
|
+ icon: "share-variant"
|
|
24
|
+ },
|
|
25
|
+ {
|
|
26
|
+ name: i18n.t("amicaleAbout.roles.culture"),
|
|
27
|
+ email: "culture@amicale-insat.fr",
|
|
28
|
+ icon: "book"
|
|
29
|
+ },
|
|
30
|
+ {
|
|
31
|
+ name: i18n.t("amicaleAbout.roles.animation"),
|
|
32
|
+ email: "animation@amicale-insat.fr",
|
|
33
|
+ icon: "emoticon"
|
|
34
|
+ },
|
|
35
|
+ {
|
|
36
|
+ name: i18n.t("amicaleAbout.roles.clubs"),
|
|
37
|
+ email: "clubs@amicale-insat.fr",
|
|
38
|
+ icon: "account-group"
|
|
39
|
+ },
|
|
40
|
+ {
|
|
41
|
+ name: i18n.t("amicaleAbout.roles.event"),
|
|
42
|
+ email: "evenements@amicale-insat.fr",
|
|
43
|
+ icon: "calendar-range"
|
|
44
|
+ },
|
|
45
|
+ {
|
|
46
|
+ name: i18n.t("amicaleAbout.roles.tech"),
|
|
47
|
+ email: "technique@amicale-insat.fr",
|
|
48
|
+ icon: "settings"
|
|
49
|
+ },
|
|
50
|
+ {
|
|
51
|
+ name: i18n.t("amicaleAbout.roles.communication"),
|
|
52
|
+ email: "amicale@amicale-insat.fr",
|
|
53
|
+ icon: "comment-account"
|
|
54
|
+ },
|
|
55
|
+ {
|
|
56
|
+ name: i18n.t("amicaleAbout.roles.intraSchools"),
|
|
57
|
+ email: "intra.ecoles@amicale-insat.fr",
|
|
58
|
+ icon: "school"
|
|
59
|
+ },
|
|
60
|
+ {
|
|
61
|
+ name: i18n.t("amicaleAbout.roles.publicRelations"),
|
|
62
|
+ email: "rp@amicale-insat.fr",
|
|
63
|
+ icon: "account-tie"
|
|
64
|
+ },
|
|
65
|
+ ];
|
|
66
|
+
|
|
67
|
+ colors: Object;
|
|
68
|
+
|
|
69
|
+ constructor(props) {
|
|
70
|
+ super(props);
|
|
71
|
+ this.colors = props.theme.colors;
|
|
72
|
+ }
|
|
73
|
+
|
|
74
|
+ keyExtractor = (item: Object) => item.email;
|
|
75
|
+
|
|
76
|
+ getChevronIcon = (props: Object) => <List.Icon {...props} icon={'chevron-right'}/>;
|
|
77
|
+
|
|
78
|
+ renderItem = ({item}: Object) => {
|
|
79
|
+ const onPress = () => Linking.openURL('mailto:' + item.email);
|
|
80
|
+ return <List.Item
|
|
81
|
+ title={item.name}
|
|
82
|
+ description={item.email}
|
|
83
|
+ left={(props) => <List.Icon {...props} icon={item.icon}/>}
|
|
84
|
+ right={this.getChevronIcon}
|
|
85
|
+ onPress={onPress}
|
|
86
|
+ />
|
|
87
|
+ };
|
|
88
|
+
|
|
89
|
+ getScreen = () => {
|
|
90
|
+ return (
|
|
91
|
+ <View>
|
|
92
|
+ <View style={{
|
|
93
|
+ width: '100%',
|
|
94
|
+ height: 100,
|
|
95
|
+ marginTop: 20,
|
|
96
|
+ marginBottom: 20,
|
|
97
|
+ justifyContent: 'center',
|
|
98
|
+ alignItems: 'center'
|
|
99
|
+ }}>
|
|
100
|
+ <Image
|
|
101
|
+ source={require('../../../assets/amicale.png')}
|
|
102
|
+ style={{flex: 1, resizeMode: "contain"}}
|
|
103
|
+ resizeMode="contain"/>
|
|
104
|
+ </View>
|
|
105
|
+ <Card style={{margin: 5}}>
|
|
106
|
+ <Card.Title
|
|
107
|
+ title={i18n.t("amicaleAbout.title")}
|
|
108
|
+ subtitle={i18n.t("amicaleAbout.subtitle")}
|
|
109
|
+ left={props => <List.Icon {...props} icon={'information'}/>}
|
|
110
|
+ />
|
|
111
|
+ <Card.Content>
|
|
112
|
+ <Text>{i18n.t("amicaleAbout.message")}</Text>
|
|
113
|
+ {/*$FlowFixMe*/}
|
|
114
|
+ <FlatList
|
|
115
|
+ data={this.CONTACT_DATASET}
|
|
116
|
+ keyExtractor={this.keyExtractor}
|
|
117
|
+ renderItem={this.renderItem}
|
|
118
|
+ />
|
|
119
|
+ </Card.Content>
|
|
120
|
+ </Card>
|
|
121
|
+ </View>
|
|
122
|
+ );
|
|
123
|
+ };
|
|
124
|
+
|
|
125
|
+ render() {
|
|
126
|
+ return (
|
|
127
|
+ //$FlowFixMe
|
|
128
|
+ <FlatList
|
|
129
|
+ data={[{key: "1"}]}
|
|
130
|
+ renderItem={this.getScreen}
|
|
131
|
+ />
|
|
132
|
+ );
|
|
133
|
+ }
|
|
134
|
+}
|
|
135
|
+
|
|
136
|
+export default withTheme(AmicaleContactScreen);
|