forked from vergnet/application-amicale
Added amicale contact page
This commit is contained in:
parent
0f8e028159
commit
db1d5166c6
5 changed files with 205 additions and 0 deletions
|
@ -52,6 +52,11 @@ class SideBar extends React.Component<Props, State> {
|
|||
onlyWhenLoggedOut: true,
|
||||
shouldEmphasis: true,
|
||||
},
|
||||
{
|
||||
name: i18n.t('screens.amicaleAbout'),
|
||||
route: "amicale-contact",
|
||||
icon: "information",
|
||||
},
|
||||
{
|
||||
name: i18n.t('screens.profile'),
|
||||
route: "profile",
|
||||
|
|
|
@ -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 (
|
||||
<AmicaleContactStack.Navigator
|
||||
initialRouteName="amicale-contact"
|
||||
headerMode="float"
|
||||
screenOptions={defaultScreenOptions}
|
||||
>
|
||||
<AmicaleContactStack.Screen
|
||||
name="amicale-contact"
|
||||
component={AmicaleContactScreen}
|
||||
options={({navigation}) => {
|
||||
const openDrawer = getDrawerButton.bind(this, navigation);
|
||||
return {
|
||||
title: i18n.t('screens.amicaleAbout'),
|
||||
headerLeft: openDrawer
|
||||
};
|
||||
}}
|
||||
/>
|
||||
</AmicaleContactStack.Navigator>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
const ClubStack = createStackNavigator();
|
||||
|
||||
function ClubStackComponent() {
|
||||
|
@ -397,6 +423,10 @@ export default class DrawerNavigator extends React.Component<Props> {
|
|||
name="vote"
|
||||
component={VoteStackComponent}
|
||||
/>
|
||||
<Drawer.Screen
|
||||
name="amicale-contact"
|
||||
component={AmicaleContactStackComponent}
|
||||
/>
|
||||
</Drawer.Navigator>
|
||||
);
|
||||
}
|
||||
|
|
136
src/screens/Amicale/AmicaleContactScreen.js
Normal file
136
src/screens/Amicale/AmicaleContactScreen.js
Normal file
|
@ -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<Props, State> {
|
||||
|
||||
|
||||
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) => <List.Icon {...props} icon={'chevron-right'}/>;
|
||||
|
||||
renderItem = ({item}: Object) => {
|
||||
const onPress = () => Linking.openURL('mailto:' + item.email);
|
||||
return <List.Item
|
||||
title={item.name}
|
||||
description={item.email}
|
||||
left={(props) => <List.Icon {...props} icon={item.icon}/>}
|
||||
right={this.getChevronIcon}
|
||||
onPress={onPress}
|
||||
/>
|
||||
};
|
||||
|
||||
getScreen = () => {
|
||||
return (
|
||||
<View>
|
||||
<View style={{
|
||||
width: '100%',
|
||||
height: 100,
|
||||
marginTop: 20,
|
||||
marginBottom: 20,
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center'
|
||||
}}>
|
||||
<Image
|
||||
source={require('../../../assets/amicale.png')}
|
||||
style={{flex: 1, resizeMode: "contain"}}
|
||||
resizeMode="contain"/>
|
||||
</View>
|
||||
<Card style={{margin: 5}}>
|
||||
<Card.Title
|
||||
title={i18n.t("amicaleAbout.title")}
|
||||
subtitle={i18n.t("amicaleAbout.subtitle")}
|
||||
left={props => <List.Icon {...props} icon={'information'}/>}
|
||||
/>
|
||||
<Card.Content>
|
||||
<Text>{i18n.t("amicaleAbout.message")}</Text>
|
||||
{/*$FlowFixMe*/}
|
||||
<FlatList
|
||||
data={this.CONTACT_DATASET}
|
||||
keyExtractor={this.keyExtractor}
|
||||
renderItem={this.renderItem}
|
||||
/>
|
||||
</Card.Content>
|
||||
</Card>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
render() {
|
||||
return (
|
||||
//$FlowFixMe
|
||||
<FlatList
|
||||
data={[{key: "1"}]}
|
||||
renderItem={this.getScreen}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default withTheme(AmicaleContactScreen);
|
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in a new issue