From db1d5166c61aecf3f830e5da328a20b152ca06a4 Mon Sep 17 00:00:00 2001 From: Arnaud Vergnet Date: Fri, 10 Apr 2020 17:10:10 +0200 Subject: [PATCH] Added amicale contact page --- src/components/Sidebar/Sidebar.js | 5 + src/navigation/DrawerNavigator.js | 30 +++++ src/screens/Amicale/AmicaleContactScreen.js | 136 ++++++++++++++++++++ translations/en.json | 17 +++ translations/fr.json | 17 +++ 5 files changed, 205 insertions(+) create mode 100644 src/screens/Amicale/AmicaleContactScreen.js diff --git a/src/components/Sidebar/Sidebar.js b/src/components/Sidebar/Sidebar.js index 1f306bc..8e8a00f 100644 --- a/src/components/Sidebar/Sidebar.js +++ b/src/components/Sidebar/Sidebar.js @@ -52,6 +52,11 @@ class SideBar extends React.Component { onlyWhenLoggedOut: true, shouldEmphasis: true, }, + { + name: i18n.t('screens.amicaleAbout'), + route: "amicale-contact", + icon: "information", + }, { name: i18n.t('screens.profile'), route: "profile", diff --git a/src/navigation/DrawerNavigator.js b/src/navigation/DrawerNavigator.js index 8dc27d7..db887e1 100644 --- a/src/navigation/DrawerNavigator.js +++ b/src/navigation/DrawerNavigator.js @@ -21,6 +21,7 @@ import ClubListScreen from "../screens/Amicale/Clubs/ClubListScreen"; import ClubDisplayScreen from "../screens/Amicale/Clubs/ClubDisplayScreen"; import ClubAboutScreen from "../screens/Amicale/Clubs/ClubAboutScreen"; import VoteScreen from "../screens/Amicale/VoteScreen"; +import AmicaleContactScreen from "../screens/Amicale/AmicaleContactScreen"; const defaultScreenOptions = { gestureEnabled: true, @@ -275,6 +276,31 @@ function VoteStackComponent() { ); } +const AmicaleContactStack = createStackNavigator(); + +function AmicaleContactStackComponent() { + return ( + + { + const openDrawer = getDrawerButton.bind(this, navigation); + return { + title: i18n.t('screens.amicaleAbout'), + headerLeft: openDrawer + }; + }} + /> + + ); +} + + const ClubStack = createStackNavigator(); function ClubStackComponent() { @@ -397,6 +423,10 @@ export default class DrawerNavigator extends React.Component { name="vote" component={VoteStackComponent} /> + ); } diff --git a/src/screens/Amicale/AmicaleContactScreen.js b/src/screens/Amicale/AmicaleContactScreen.js new file mode 100644 index 0000000..544dad7 --- /dev/null +++ b/src/screens/Amicale/AmicaleContactScreen.js @@ -0,0 +1,136 @@ +// @flow + +import * as React from 'react'; +import {FlatList, Image, View} from 'react-native'; +import {Card, List, Text, withTheme} from 'react-native-paper'; +import i18n from 'i18n-js'; +import {Linking} from "expo"; + +type Props = {}; + +type State = {}; + +/** + * Class defining a planning event information page. + */ +class AmicaleContactScreen extends React.Component { + + + CONTACT_DATASET = [ + { + name: i18n.t("amicaleAbout.roles.interSchools"), + email: "inter.ecoles@amicale-insat.fr", + icon: "share-variant" + }, + { + name: i18n.t("amicaleAbout.roles.culture"), + email: "culture@amicale-insat.fr", + icon: "book" + }, + { + name: i18n.t("amicaleAbout.roles.animation"), + email: "animation@amicale-insat.fr", + icon: "emoticon" + }, + { + name: i18n.t("amicaleAbout.roles.clubs"), + email: "clubs@amicale-insat.fr", + icon: "account-group" + }, + { + name: i18n.t("amicaleAbout.roles.event"), + email: "evenements@amicale-insat.fr", + icon: "calendar-range" + }, + { + name: i18n.t("amicaleAbout.roles.tech"), + email: "technique@amicale-insat.fr", + icon: "settings" + }, + { + name: i18n.t("amicaleAbout.roles.communication"), + email: "amicale@amicale-insat.fr", + icon: "comment-account" + }, + { + name: i18n.t("amicaleAbout.roles.intraSchools"), + email: "intra.ecoles@amicale-insat.fr", + icon: "school" + }, + { + name: i18n.t("amicaleAbout.roles.publicRelations"), + email: "rp@amicale-insat.fr", + icon: "account-tie" + }, + ]; + + colors: Object; + + constructor(props) { + super(props); + this.colors = props.theme.colors; + } + + keyExtractor = (item: Object) => item.email; + + getChevronIcon = (props: Object) => ; + + renderItem = ({item}: Object) => { + const onPress = () => Linking.openURL('mailto:' + item.email); + return } + right={this.getChevronIcon} + onPress={onPress} + /> + }; + + getScreen = () => { + return ( + + + + + + } + /> + + {i18n.t("amicaleAbout.message")} + {/*$FlowFixMe*/} + + + + + ); + }; + + render() { + return ( + //$FlowFixMe + + ); + } +} + +export default withTheme(AmicaleContactScreen); diff --git a/translations/en.json b/translations/en.json index 71a3a9c..46449c8 100644 --- a/translations/en.json +++ b/translations/en.json @@ -5,6 +5,7 @@ "planningDisplayScreen": "Event details", "clubDisplayScreen": "Club details", "clubsAbout": "Clubs", + "amicaleAbout": "The Amicale", "proxiwash": "Proxiwash", "proximo": "Proximo", "proximoArticles": "Articles", @@ -279,6 +280,22 @@ "message": "You have a question concerning the clubs?\nYou want to revive or create a club?\nContact the Amicale at the following address:" } }, + "amicaleAbout": { + "title": "A question ?", + "subtitle": "Ask the Amicale", + "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!", + "roles": { + "interSchools": "Inter Schools", + "culture": "Culture", + "animation": "Animation", + "clubs": "Clubs", + "event": "Events", + "tech" : "Technique", + "communication": "Communication", + "intraSchools": "Alumni / IAT", + "publicRelations": "Public Relations" + } + }, "voteScreen": { "select": { "title": "Elections open", diff --git a/translations/fr.json b/translations/fr.json index 49e565d..71a0b19 100644 --- a/translations/fr.json +++ b/translations/fr.json @@ -5,6 +5,7 @@ "planningDisplayScreen": "Détails", "clubDisplayScreen": "Détails", "clubsAbout": "Les Clubs", + "amicaleAbout": "L' Amicale", "proxiwash": "Proxiwash", "proximo": "Proximo", "proximoArticles": "Articles", @@ -279,6 +280,22 @@ "message": "Vous avez question concernant les clubs ?\nVous voulez reprendre ou créer un club ?\nContactez les responsables au mail ci-dessous :" } }, + "amicaleAbout": { + "title": "Une Question ?", + "subtitle": "Posez vos questions à l'Amicale", + "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 !", + "roles": { + "interSchools": "Inter Écoles", + "culture": "Culture", + "animation": "Animation", + "clubs": "Clubs", + "event": "Événements", + "tech" : "Technique", + "communication": "Communication", + "intraSchools": "Alumni / IAT", + "publicRelations": "Relations Publiques" + } + }, "voteScreen": { "select": { "title": "Élections ouvertes",