Compare commits
No commits in common. "c3d324549d7e6f441eb028f9bca2f019094dad04" and "43cf7dc874e761182ea51984f6705c8228a092e8" have entirely different histories.
c3d324549d
...
43cf7dc874
4 changed files with 67 additions and 278 deletions
|
|
@ -346,20 +346,12 @@
|
|||
"license": "License",
|
||||
"debug": "Debug",
|
||||
"team": "Team",
|
||||
"author": "Author and maintainer",
|
||||
"authorMail": "Send an email",
|
||||
"additionalDev": "Thanks",
|
||||
"technologies": "Technologies",
|
||||
"reactNative": "Made with React Native",
|
||||
"libs": "Libraries used",
|
||||
"thanks": "Thanks",
|
||||
"user": {
|
||||
"you": "You ?",
|
||||
"arnaud": "Student in IR (2020). He is the creator of this beautiful app you use everyday. Some say he is handsome as well.",
|
||||
"yohan": "Student in IR (2020). He helped to fix bugs. I think he is handsome as well but I don't know him personally.",
|
||||
"beranger": "Student in AE (2020) and president of the Amicale when the app was created. The app was his idea. He helped a lot to find bugs, new features and communication.",
|
||||
"celine": "Student in GPE (2020). Without her, everything would be less cute. She helped to write the text, for communication, and also to create the mascot 🦊.",
|
||||
"damien": "Student in IR (2020) and creator of the 2020 version of the Amicale's website. Thanks to his help, integrating Amicale's services into the app was child's play.",
|
||||
"titouan": "Student in IR (2020). He helped a lot in finding bugs and new features.",
|
||||
"theo": "Student in AE (2020). If the app works on iOS, this is all thanks to his help during his numerous tests."
|
||||
}
|
||||
"libs": "Libraries used"
|
||||
},
|
||||
"feedback": {
|
||||
"title": "Contribute",
|
||||
|
|
|
|||
|
|
@ -345,20 +345,12 @@
|
|||
"license": "Licence",
|
||||
"debug": "Debug",
|
||||
"team": "Équipe",
|
||||
"author": "Auteur et mainteneur",
|
||||
"authorMail": "Envoyer un mail",
|
||||
"additionalDev": "Remerciements",
|
||||
"technologies": "Technologies",
|
||||
"reactNative": "Créé avec React Native",
|
||||
"libs": "Librairies utilisées",
|
||||
"thanks": "Remerciements",
|
||||
"user": {
|
||||
"you": "Toi ?",
|
||||
"arnaud": "Étudiant en IR (2020). C'est le créateur de cette magnifique application que t'utilises tous les jour. Et il est vraiment BG aussi.",
|
||||
"yohan": "Étudiant en IR (2020). Il a aidé à corriger des bug. Et j'imagine aussi qu'il est BG mais je le connait pas.",
|
||||
"beranger": "Étudiant en AE (2020) et Président de l’Amicale au moment de la création et du lancement du projet. L’application, c’était son idée. Il a beaucoup aidé pour trouver des bugs, de nouvelles fonctionnalités et faire de la com.",
|
||||
"celine": "Étudiante en GPE (2020). Sans elle, tout serait moins mignon. Elle a aidé pour écrire le texte, faire de la com, et aussi à créer la mascotte 🦊.",
|
||||
"damien": "Étudiant en IR (2020) et créateur de la dernière version du site de l’Amicale. Grâce à son aide, intégrer les services de l’Amicale à l’application a été très simple.",
|
||||
"titouan": "Étudiant en IR (2020). Il a beaucoup aidé pour trouver des bugs et proposer des nouvelles fonctionnalités.",
|
||||
"theo": "Étudiant en AE (2020). Si l’application marche sur iOS, c’est grâce à son aide lors de ses nombreux tests."
|
||||
}
|
||||
"libs": "Librairies utilisées"
|
||||
},
|
||||
"feedback": {
|
||||
"title": "Participer",
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import {FlatList} from 'react-native';
|
|||
|
||||
export type OptionsDialogButtonType = {
|
||||
title: string,
|
||||
icon?: string,
|
||||
onPress: () => void,
|
||||
};
|
||||
|
||||
|
|
@ -20,19 +19,10 @@ type PropsType = {
|
|||
|
||||
class OptionsDialog extends React.PureComponent<PropsType> {
|
||||
getButtonRender = ({item}: {item: OptionsDialogButtonType}): React.Node => {
|
||||
return (
|
||||
<Button onPress={item.onPress} icon={item.icon}>
|
||||
{item.title}
|
||||
</Button>
|
||||
);
|
||||
return <Button onPress={item.onPress}>{item.title}</Button>;
|
||||
};
|
||||
|
||||
keyExtractor = (item: OptionsDialogButtonType): string => {
|
||||
if (item.icon != null) {
|
||||
return item.title + item.icon;
|
||||
}
|
||||
return item.title;
|
||||
};
|
||||
keyExtractor = (item: OptionsDialogButtonType): string => item.title;
|
||||
|
||||
render(): React.Node {
|
||||
const {props} = this;
|
||||
|
|
|
|||
|
|
@ -1,19 +1,17 @@
|
|||
// @flow
|
||||
|
||||
import * as React from 'react';
|
||||
import {FlatList, Linking, Platform, Image, View} from 'react-native';
|
||||
import {FlatList, Linking, Platform, Image} from 'react-native';
|
||||
import i18n from 'i18n-js';
|
||||
import {Avatar, Card, List, withTheme} from 'react-native-paper';
|
||||
import {Avatar, Card, List, Title, withTheme} from 'react-native-paper';
|
||||
import {StackNavigationProp} from '@react-navigation/stack';
|
||||
import packageJson from '../../../package.json';
|
||||
import CollapsibleFlatList from '../../components/Collapsible/CollapsibleFlatList';
|
||||
import APP_LOGO from '../../../assets/android.icon.round.png';
|
||||
import APP_LOGO from '../../../assets/android.icon.png';
|
||||
import type {
|
||||
CardTitleIconPropsType,
|
||||
ListIconPropsType,
|
||||
} from '../../constants/PaperStyles';
|
||||
import OptionsDialog from '../../components/Dialogs/OptionsDialog';
|
||||
import type {OptionsDialogButtonType} from '../../components/Dialogs/OptionsDialog';
|
||||
|
||||
type ListItemType = {
|
||||
onPressCallback: () => void,
|
||||
|
|
@ -22,15 +20,6 @@ type ListItemType = {
|
|||
showChevron: boolean,
|
||||
};
|
||||
|
||||
type MemberItemType = {
|
||||
name: string,
|
||||
message: string,
|
||||
icon: string,
|
||||
trollLink?: string,
|
||||
linkedin?: string,
|
||||
mail?: string,
|
||||
};
|
||||
|
||||
const links = {
|
||||
appstore: 'https://apps.apple.com/us/app/campus-amicale-insat/id1477722148',
|
||||
playstore:
|
||||
|
|
@ -41,20 +30,28 @@ const links = {
|
|||
'https://git.etud.insa-toulouse.fr/vergnet/application-amicale/src/branch/master/Changelog.md',
|
||||
license:
|
||||
'https://git.etud.insa-toulouse.fr/vergnet/application-amicale/src/branch/master/LICENSE',
|
||||
authorMail:
|
||||
'mailto:vergnet@etud.insa-toulouse.fr?' +
|
||||
'subject=' +
|
||||
'Application Amicale INSA Toulouse' +
|
||||
'&body=' +
|
||||
'Coucou !\n\n',
|
||||
authorLinkedin: 'https://www.linkedin.com/in/arnaud-vergnet-434ba5179/',
|
||||
yohanMail:
|
||||
'mailto:ysimard@etud.insa-toulouse.fr?' +
|
||||
'subject=' +
|
||||
'Application Amicale INSA Toulouse' +
|
||||
'&body=' +
|
||||
'Coucou !\n\n',
|
||||
yohanLinkedin: 'https://www.linkedin.com/in/yohan-simard',
|
||||
react: 'https://facebook.github.io/react-native/',
|
||||
meme: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ',
|
||||
};
|
||||
|
||||
type PropsType = {
|
||||
navigation: StackNavigationProp,
|
||||
};
|
||||
|
||||
type StateType = {
|
||||
dialogVisible: boolean,
|
||||
dialogTitle: string,
|
||||
dialogMessage: string,
|
||||
dialogButtons: Array<OptionsDialogButtonType>,
|
||||
};
|
||||
|
||||
/**
|
||||
* Opens a link in the device's browser
|
||||
* @param link The link to open
|
||||
|
|
@ -63,76 +60,14 @@ function openWebLink(link: string) {
|
|||
Linking.openURL(link);
|
||||
}
|
||||
|
||||
/**
|
||||
* Object containing data relative to major contributors
|
||||
*/
|
||||
const majorContributors: {[key: string]: MemberItemType} = {
|
||||
arnaud: {
|
||||
name: 'Arnaud Vergnet',
|
||||
message: i18n.t('screens.about.user.arnaud'),
|
||||
icon: 'crown',
|
||||
trollLink: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ',
|
||||
linkedin: 'https://www.linkedin.com/in/arnaud-vergnet-434ba5179/',
|
||||
mail:
|
||||
'mailto:vergnet@etud.insa-toulouse.fr?' +
|
||||
'subject=' +
|
||||
'Application Amicale INSA Toulouse' +
|
||||
'&body=' +
|
||||
'Coucou !\n\n',
|
||||
},
|
||||
yohan: {
|
||||
name: 'Yohan Simard',
|
||||
message: i18n.t('screens.about.user.yohan'),
|
||||
icon: 'xml',
|
||||
linkedin: 'https://www.linkedin.com/in/yohan-simard',
|
||||
mail: 'mailto:ysimard@etud.insa-toulouse.fr?' +
|
||||
'subject=' +
|
||||
'Application Amicale INSA Toulouse' +
|
||||
'&body=' +
|
||||
'Coucou !\n\n',
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* Object containing data relative to users who helped during development
|
||||
*/
|
||||
const helpfulUsers: {[key: string]: MemberItemType} = {
|
||||
beranger: {
|
||||
name: 'Béranger Quintana Y Arciosana',
|
||||
message: i18n.t('screens.about.user.beranger'),
|
||||
icon: 'account-heart',
|
||||
},
|
||||
celine: {
|
||||
name: 'Céline Tassin',
|
||||
message: i18n.t('screens.about.user.celine'),
|
||||
icon: 'brush',
|
||||
},
|
||||
damien: {
|
||||
name: 'Damien Molina',
|
||||
message: i18n.t('screens.about.user.damien'),
|
||||
icon: 'web',
|
||||
},
|
||||
titouan: {
|
||||
name: 'Titouan Labourdette',
|
||||
message: i18n.t('screens.about.user.titouan'),
|
||||
icon: 'shield-bug',
|
||||
},
|
||||
theo: {
|
||||
name: 'Théo Tami',
|
||||
message: i18n.t('screens.about.user.theo'),
|
||||
icon: 'food-apple',
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* Class defining an about screen. This screen shows the user information about the app and it's author.
|
||||
*/
|
||||
class AboutScreen extends React.Component<PropsType, StateType> {
|
||||
|
||||
class AboutScreen extends React.Component<PropsType> {
|
||||
/**
|
||||
* Data to be displayed in the app card
|
||||
*/
|
||||
appData: Array<ListItemType> = [
|
||||
appData = [
|
||||
{
|
||||
onPressCallback: () => {
|
||||
openWebLink(Platform.OS === 'ios' ? links.appstore : links.playstore);
|
||||
|
|
@ -180,79 +115,60 @@ class AboutScreen extends React.Component<PropsType, StateType> {
|
|||
];
|
||||
|
||||
/**
|
||||
* Data to be displayed in the team card
|
||||
* Data to be displayed in the author card
|
||||
*/
|
||||
teamData: Array<ListItemType> = [
|
||||
authorData = [
|
||||
{
|
||||
onPressCallback: () => {
|
||||
this.onContributorListItemPress(majorContributors.arnaud);
|
||||
openWebLink(links.meme);
|
||||
},
|
||||
icon: majorContributors.arnaud.icon,
|
||||
text: majorContributors.arnaud.name,
|
||||
icon: 'account-circle',
|
||||
text: 'Arnaud VERGNET',
|
||||
showChevron: false,
|
||||
},
|
||||
{
|
||||
onPressCallback: () => {
|
||||
this.onContributorListItemPress(majorContributors.yohan);
|
||||
openWebLink(links.authorMail);
|
||||
},
|
||||
icon: majorContributors.yohan.icon,
|
||||
text: majorContributors.yohan.name,
|
||||
showChevron: false,
|
||||
icon: 'email',
|
||||
text: i18n.t('screens.about.authorMail'),
|
||||
showChevron: true,
|
||||
},
|
||||
{
|
||||
onPressCallback: () => {
|
||||
const {navigation} = this.props;
|
||||
navigation.navigate('feedback');
|
||||
openWebLink(links.authorLinkedin);
|
||||
},
|
||||
icon: 'hand-pointing-right',
|
||||
text: i18n.t('screens.about.user.you'),
|
||||
icon: 'linkedin',
|
||||
text: 'Linkedin',
|
||||
showChevron: true,
|
||||
},
|
||||
];
|
||||
|
||||
/**
|
||||
* Data to be displayed in the thanks card
|
||||
* Data to be displayed in the additional developer card
|
||||
*/
|
||||
thanksData: Array<ListItemType> = [
|
||||
additionalDevData = [
|
||||
{
|
||||
onPressCallback: () => {
|
||||
this.onContributorListItemPress(helpfulUsers.beranger);
|
||||
},
|
||||
icon: helpfulUsers.beranger.icon,
|
||||
text: helpfulUsers.beranger.name,
|
||||
onPressCallback: () => {},
|
||||
icon: 'account',
|
||||
text: 'Yohan SIMARD',
|
||||
showChevron: false,
|
||||
},
|
||||
{
|
||||
onPressCallback: () => {
|
||||
this.onContributorListItemPress(helpfulUsers.celine);
|
||||
openWebLink(links.yohanMail);
|
||||
},
|
||||
icon: helpfulUsers.celine.icon,
|
||||
text: helpfulUsers.celine.name,
|
||||
showChevron: false,
|
||||
icon: 'email',
|
||||
text: i18n.t('screens.about.authorMail'),
|
||||
showChevron: true,
|
||||
},
|
||||
{
|
||||
onPressCallback: () => {
|
||||
this.onContributorListItemPress(helpfulUsers.damien);
|
||||
openWebLink(links.yohanLinkedin);
|
||||
},
|
||||
icon: helpfulUsers.damien.icon,
|
||||
text: helpfulUsers.damien.name,
|
||||
showChevron: false,
|
||||
},
|
||||
{
|
||||
onPressCallback: () => {
|
||||
this.onContributorListItemPress(helpfulUsers.titouan);
|
||||
},
|
||||
icon: helpfulUsers.titouan.icon,
|
||||
text: helpfulUsers.titouan.name,
|
||||
showChevron: false,
|
||||
},
|
||||
{
|
||||
onPressCallback: () => {
|
||||
this.onContributorListItemPress(helpfulUsers.theo);
|
||||
},
|
||||
icon: helpfulUsers.theo.icon,
|
||||
text: helpfulUsers.theo.name,
|
||||
showChevron: false,
|
||||
icon: 'linkedin',
|
||||
text: 'Linkedin',
|
||||
showChevron: true,
|
||||
},
|
||||
];
|
||||
|
||||
|
|
@ -289,72 +205,11 @@ class AboutScreen extends React.Component<PropsType, StateType> {
|
|||
{
|
||||
id: 'team',
|
||||
},
|
||||
{
|
||||
id: 'thanks',
|
||||
},
|
||||
{
|
||||
id: 'techno',
|
||||
},
|
||||
];
|
||||
|
||||
constructor(props: PropsType) {
|
||||
super(props);
|
||||
this.state = {
|
||||
dialogVisible: false,
|
||||
dialogTitle: '',
|
||||
dialogMessage: '',
|
||||
dialogButtons: [],
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback used when clicking a member in the list
|
||||
* It opens a dialog to show detailed information this member
|
||||
*
|
||||
* @param user The member to show information for
|
||||
*/
|
||||
onContributorListItemPress(user: MemberItemType) {
|
||||
const dialogBtn = [
|
||||
{
|
||||
title: 'OK',
|
||||
onPress: this.onDialogDismiss,
|
||||
},
|
||||
];
|
||||
const {linkedin, trollLink, mail} = user;
|
||||
if (linkedin != null) {
|
||||
dialogBtn.push({
|
||||
title: '',
|
||||
icon: 'linkedin',
|
||||
onPress: () => {
|
||||
openWebLink(linkedin);
|
||||
},
|
||||
});
|
||||
}
|
||||
if (mail) {
|
||||
dialogBtn.push({
|
||||
title: '',
|
||||
icon: 'email-edit',
|
||||
onPress: () => {
|
||||
openWebLink(mail);
|
||||
},
|
||||
});
|
||||
}
|
||||
if (trollLink) {
|
||||
dialogBtn.push({
|
||||
title: 'SWAG',
|
||||
onPress: () => {
|
||||
openWebLink(trollLink);
|
||||
},
|
||||
});
|
||||
}
|
||||
this.setState({
|
||||
dialogVisible: true,
|
||||
dialogTitle: user.name,
|
||||
dialogMessage: user.message,
|
||||
dialogButtons: dialogBtn,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the app card showing information and links about the app.
|
||||
*
|
||||
|
|
@ -400,34 +255,18 @@ class AboutScreen extends React.Component<PropsType, StateType> {
|
|||
)}
|
||||
/>
|
||||
<Card.Content>
|
||||
<Title>{i18n.t('screens.about.author')}</Title>
|
||||
<FlatList
|
||||
data={this.teamData}
|
||||
data={this.authorData}
|
||||
keyExtractor={this.keyExtractor}
|
||||
listKey="1"
|
||||
renderItem={this.getCardItem}
|
||||
/>
|
||||
</Card.Content>
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the thank you card showing support information and links
|
||||
*
|
||||
* @return {*}
|
||||
*/
|
||||
getThanksCard(): React.Node {
|
||||
return (
|
||||
<Card style={{marginBottom: 10}}>
|
||||
<Card.Title
|
||||
title={i18n.t('screens.about.thanks')}
|
||||
left={(iconProps: CardTitleIconPropsType): React.Node => (
|
||||
<Avatar.Icon size={iconProps.size} icon="hand-heart" />
|
||||
)}
|
||||
/>
|
||||
<Card.Content>
|
||||
<Title>{i18n.t('screens.about.additionalDev')}</Title>
|
||||
<FlatList
|
||||
data={this.thanksData}
|
||||
data={this.additionalDevData}
|
||||
keyExtractor={this.keyExtractor}
|
||||
listKey="2"
|
||||
renderItem={this.getCardItem}
|
||||
/>
|
||||
</Card.Content>
|
||||
|
|
@ -443,13 +282,8 @@ class AboutScreen extends React.Component<PropsType, StateType> {
|
|||
getTechnoCard(): React.Node {
|
||||
return (
|
||||
<Card style={{marginBottom: 10}}>
|
||||
<Card.Title
|
||||
title={i18n.t('screens.about.technologies')}
|
||||
left={(iconProps: CardTitleIconPropsType): React.Node => (
|
||||
<Avatar.Icon size={iconProps.size} icon="wrench" />
|
||||
)}
|
||||
/>
|
||||
<Card.Content>
|
||||
<Title>{i18n.t('screens.about.technologies')}</Title>
|
||||
<FlatList
|
||||
data={this.technoData}
|
||||
keyExtractor={this.keyExtractor}
|
||||
|
|
@ -524,8 +358,6 @@ class AboutScreen extends React.Component<PropsType, StateType> {
|
|||
return this.getAppCard();
|
||||
case 'team':
|
||||
return this.getTeamCard();
|
||||
case 'thanks':
|
||||
return this.getThanksCard();
|
||||
case 'techno':
|
||||
return this.getTechnoCard();
|
||||
default:
|
||||
|
|
@ -533,10 +365,6 @@ class AboutScreen extends React.Component<PropsType, StateType> {
|
|||
}
|
||||
};
|
||||
|
||||
onDialogDismiss = () => {
|
||||
this.setState({dialogVisible: false});
|
||||
};
|
||||
|
||||
/**
|
||||
* Extracts a key from the given item
|
||||
*
|
||||
|
|
@ -546,25 +374,12 @@ class AboutScreen extends React.Component<PropsType, StateType> {
|
|||
keyExtractor = (item: ListItemType): string => item.icon;
|
||||
|
||||
render(): React.Node {
|
||||
const {state} = this;
|
||||
return (
|
||||
<View
|
||||
style={{
|
||||
height: '100%',
|
||||
}}>
|
||||
<CollapsibleFlatList
|
||||
style={{padding: 5}}
|
||||
data={this.dataOrder}
|
||||
renderItem={this.getMainCard}
|
||||
/>
|
||||
<OptionsDialog
|
||||
visible={state.dialogVisible}
|
||||
title={state.dialogTitle}
|
||||
message={state.dialogMessage}
|
||||
buttons={state.dialogButtons}
|
||||
onDismiss={this.onDialogDismiss}
|
||||
/>
|
||||
</View>
|
||||
<CollapsibleFlatList
|
||||
style={{padding: 5}}
|
||||
data={this.dataOrder}
|
||||
renderItem={this.getMainCard}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue