/*
* Copyright (c) 2019 - 2020 Arnaud Vergnet.
*
* This file is part of Campus INSAT.
*
* Campus INSAT is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Campus INSAT is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Campus INSAT. If not, see .
*/
import * as React from 'react';
import {FlatList, Image, Linking, View} from 'react-native';
import {Avatar, Card, List, Text} from 'react-native-paper';
import i18n from 'i18n-js';
import CollapsibleFlatList from '../../components/Collapsible/CollapsibleFlatList';
const AMICALE_LOGO = require('../../../assets/amicale.png');
type DatasetItemType = {
name: string;
email: string;
icon: string;
};
/**
* Class defining a planning event information page.
*/
class AmicaleContactScreen extends React.Component<{}> {
// Dataset containing information about contacts
CONTACT_DATASET: Array;
constructor(props: {}) {
super(props);
this.CONTACT_DATASET = [
{
name: i18n.t('screens.amicaleAbout.roles.interSchools'),
email: 'inter.ecoles@amicale-insat.fr',
icon: 'share-variant',
},
{
name: i18n.t('screens.amicaleAbout.roles.culture'),
email: 'culture@amicale-insat.fr',
icon: 'book',
},
{
name: i18n.t('screens.amicaleAbout.roles.animation'),
email: 'animation@amicale-insat.fr',
icon: 'emoticon',
},
{
name: i18n.t('screens.amicaleAbout.roles.clubs'),
email: 'clubs@amicale-insat.fr',
icon: 'account-group',
},
{
name: i18n.t('screens.amicaleAbout.roles.event'),
email: 'evenements@amicale-insat.fr',
icon: 'calendar-range',
},
{
name: i18n.t('screens.amicaleAbout.roles.tech'),
email: 'technique@amicale-insat.fr',
icon: 'cog',
},
{
name: i18n.t('screens.amicaleAbout.roles.communication'),
email: 'amicale@amicale-insat.fr',
icon: 'comment-account',
},
{
name: i18n.t('screens.amicaleAbout.roles.intraSchools'),
email: 'intra.ecoles@amicale-insat.fr',
icon: 'school',
},
{
name: i18n.t('screens.amicaleAbout.roles.publicRelations'),
email: 'rp@amicale-insat.fr',
icon: 'account-tie',
},
];
}
keyExtractor = (item: DatasetItemType): string => item.email;
getChevronIcon = (iconProps: {
color: string;
style?: {
marginRight: number;
marginVertical?: number;
};
}) => (
);
getRenderItem = ({item}: {item: DatasetItemType}) => {
const onPress = () => {
Linking.openURL(`mailto:${item.email}`);
};
return (
(
)}
right={this.getChevronIcon}
onPress={onPress}
/>
);
};
getScreen = () => {
return (
(
)}
/>
{i18n.t('screens.amicaleAbout.message')}
);
};
render() {
return (
);
}
}
export default AmicaleContactScreen;