Browse Source

Added amicale contact page

Arnaud Vergnet 4 years ago
parent
commit
db1d5166c6

+ 5
- 0
src/components/Sidebar/Sidebar.js View File

@@ -53,6 +53,11 @@ class SideBar extends React.Component<Props, State> {
53 53
                 shouldEmphasis: true,
54 54
             },
55 55
             {
56
+                name: i18n.t('screens.amicaleAbout'),
57
+                route: "amicale-contact",
58
+                icon: "information",
59
+            },
60
+            {
56 61
                 name: i18n.t('screens.profile'),
57 62
                 route: "profile",
58 63
                 icon: "account",

+ 30
- 0
src/navigation/DrawerNavigator.js View File

@@ -21,6 +21,7 @@ import ClubListScreen from "../screens/Amicale/Clubs/ClubListScreen";
21 21
 import ClubDisplayScreen from "../screens/Amicale/Clubs/ClubDisplayScreen";
22 22
 import ClubAboutScreen from "../screens/Amicale/Clubs/ClubAboutScreen";
23 23
 import VoteScreen from "../screens/Amicale/VoteScreen";
24
+import AmicaleContactScreen from "../screens/Amicale/AmicaleContactScreen";
24 25
 
25 26
 const defaultScreenOptions = {
26 27
     gestureEnabled: true,
@@ -275,6 +276,31 @@ function VoteStackComponent() {
275 276
     );
276 277
 }
277 278
 
279
+const AmicaleContactStack = createStackNavigator();
280
+
281
+function AmicaleContactStackComponent() {
282
+    return (
283
+        <AmicaleContactStack.Navigator
284
+            initialRouteName="amicale-contact"
285
+            headerMode="float"
286
+            screenOptions={defaultScreenOptions}
287
+        >
288
+            <AmicaleContactStack.Screen
289
+                name="amicale-contact"
290
+                component={AmicaleContactScreen}
291
+                options={({navigation}) => {
292
+                    const openDrawer = getDrawerButton.bind(this, navigation);
293
+                    return {
294
+                        title: i18n.t('screens.amicaleAbout'),
295
+                        headerLeft: openDrawer
296
+                    };
297
+                }}
298
+            />
299
+        </AmicaleContactStack.Navigator>
300
+    );
301
+}
302
+
303
+
278 304
 const ClubStack = createStackNavigator();
279 305
 
280 306
 function ClubStackComponent() {
@@ -397,6 +423,10 @@ export default class DrawerNavigator extends React.Component<Props> {
397 423
                     name="vote"
398 424
                     component={VoteStackComponent}
399 425
                 />
426
+                <Drawer.Screen
427
+                    name="amicale-contact"
428
+                    component={AmicaleContactStackComponent}
429
+                />
400 430
             </Drawer.Navigator>
401 431
         );
402 432
     }

+ 136
- 0
src/screens/Amicale/AmicaleContactScreen.js View File

@@ -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);

+ 17
- 0
translations/en.json View File

@@ -5,6 +5,7 @@
5 5
     "planningDisplayScreen": "Event details",
6 6
     "clubDisplayScreen": "Club details",
7 7
     "clubsAbout": "Clubs",
8
+    "amicaleAbout": "The Amicale",
8 9
     "proxiwash": "Proxiwash",
9 10
     "proximo": "Proximo",
10 11
     "proximoArticles": "Articles",
@@ -279,6 +280,22 @@
279 280
       "message": "You have a question concerning the clubs?\nYou want to revive or create a club?\nContact the Amicale at the following address:"
280 281
     }
281 282
   },
283
+  "amicaleAbout": {
284
+    "title": "A question ?",
285
+    "subtitle": "Ask the Amicale",
286
+    "message": "You want to revive a club?\nYou want to start a new project?\nHere are al the contacts you need! Do not hesitate to write a mail or send a message to the Amicale's Facebook page!",
287
+    "roles": {
288
+      "interSchools": "Inter Schools",
289
+      "culture": "Culture",
290
+      "animation": "Animation",
291
+      "clubs": "Clubs",
292
+      "event": "Events",
293
+      "tech" : "Technique",
294
+      "communication": "Communication",
295
+      "intraSchools": "Alumni / IAT",
296
+      "publicRelations": "Public Relations"
297
+    }
298
+  },
282 299
   "voteScreen": {
283 300
     "select": {
284 301
       "title": "Elections open",

+ 17
- 0
translations/fr.json View File

@@ -5,6 +5,7 @@
5 5
     "planningDisplayScreen": "Détails",
6 6
     "clubDisplayScreen": "Détails",
7 7
     "clubsAbout": "Les Clubs",
8
+    "amicaleAbout": "L' Amicale",
8 9
     "proxiwash": "Proxiwash",
9 10
     "proximo": "Proximo",
10 11
     "proximoArticles": "Articles",
@@ -279,6 +280,22 @@
279 280
       "message": "Vous avez question concernant les clubs ?\nVous voulez reprendre ou créer un club ?\nContactez les responsables au mail ci-dessous :"
280 281
     }
281 282
   },
283
+  "amicaleAbout": {
284
+    "title": "Une Question ?",
285
+    "subtitle": "Posez vos questions à l'Amicale",
286
+    "message": "Vous voulez reprendre un club ?\nVous voulez vous lancer dans un projet ?\nVoici tous les contacts de l'amicale ! N'hésitez pas à nous écrire par mail ou sur la page facebook de l'Amicale !",
287
+    "roles": {
288
+      "interSchools": "Inter Écoles",
289
+      "culture": "Culture",
290
+      "animation": "Animation",
291
+      "clubs": "Clubs",
292
+      "event": "Événements",
293
+      "tech" : "Technique",
294
+      "communication": "Communication",
295
+      "intraSchools": "Alumni / IAT",
296
+      "publicRelations": "Relations Publiques"
297
+    }
298
+  },
282 299
   "voteScreen": {
283 300
     "select": {
284 301
       "title": "Élections ouvertes",

Loading…
Cancel
Save