Added mail contact for bug reports

This commit is contained in:
keplyx 2019-09-17 11:51:26 +02:00
parent 68fe542085
commit e2f74b97e6
3 changed files with 86 additions and 20 deletions

View file

@ -2,23 +2,37 @@
import * as React from 'react';
import {FlatList, Linking, Platform, View} from 'react-native';
import {Body, Card, CardItem, Container, Content, H1, Left, Right, Text, Thumbnail} from 'native-base';
import {Body, Card, CardItem, Container, Content, H1, Left, Right, Text, Thumbnail, Button} from 'native-base';
import CustomHeader from "../../components/CustomHeader";
import i18n from "i18n-js";
import appJson from '../../app';
import packageJson from '../../package';
import CustomMaterialIcon from "../../components/CustomMaterialIcon";
import AsyncStorageManager from "../../utils/AsyncStorageManager";
import Modalize from "react-native-modalize";
import ThemeManager from "../../utils/ThemeManager";
const links = {
appstore: 'https://apps.apple.com/us/app/campus-amicale-insat/id1477722148',
playstore: 'https://play.google.com/store/apps/details?id=fr.amicaleinsat.application',
expo: 'https://expo.io/@amicaleinsat/application-amicale',
git: 'https://git.srv-falcon.etud.insa-toulouse.fr/vergnet/application-amicale/src/branch/master/README.md',
bugs: 'https://git.srv-falcon.etud.insa-toulouse.fr/vergnet/application-amicale/issues',
bugsMail: 'mailto:vergnet@etud.insa-toulouse.fr?' +
'subject=' +
'[BUG] Application Amicale INSA Toulouse' +
'&body=' +
'Coucou Arnaud ça bug c\'est nul,\n\n' +
'Informations sur ton système si tu sais (iOS ou Android, modèle du tel, version):\n\n\n' +
'Nature du problème :\n\n\n' +
'Étapes pour reproduire ce pb :\n\n\n\n' +
'Stp corrige le pb, bien cordialement.',
bugsGit: 'https://git.srv-falcon.etud.insa-toulouse.fr/vergnet/application-amicale/issues',
changelog: 'https://git.srv-falcon.etud.insa-toulouse.fr/vergnet/application-amicale/src/branch/master/Changelog.md',
license: 'https://git.srv-falcon.etud.insa-toulouse.fr/vergnet/application-amicale/src/branch/master/LICENSE',
mail: "mailto:vergnet@etud.insa-toulouse.fr?subject=Application Amicale INSA Toulouse&body=",
mail: "mailto:vergnet@etud.insa-toulouse.fr?" +
"subject=" +
"Application Amicale INSA Toulouse" +
"&body=" +
"Coucou !\n\n",
linkedin: 'https://www.linkedin.com/in/arnaud-vergnet-434ba5179/',
facebook: 'https://www.facebook.com/arnaud.vergnet',
react: 'https://facebook.github.io/react-native/',
@ -46,11 +60,17 @@ function openWebLink(link) {
export default class AboutScreen extends React.Component<Props, State> {
debugTapCounter = 0;
modalRef: { current: null | Modalize };
state = {
isDebugUnlocked: AsyncStorageManager.getInstance().preferences.debugUnlocked.current === '1'
};
constructor(props: any) {
super(props);
this.modalRef = React.createRef();
}
/**
* Data to be displayed in the app card
*/
@ -62,9 +82,9 @@ export default class AboutScreen extends React.Component<Props, State> {
showChevron: true
},
{
onPressCallback: () => openWebLink(links.expo),
icon: 'worker',
text: i18n.t('aboutScreen.expoBeta'),
onPressCallback: () => this.openBugReportModal(),
icon: 'bug',
text: i18n.t('aboutScreen.bugs'),
showChevron: true
},
{
@ -73,12 +93,6 @@ export default class AboutScreen extends React.Component<Props, State> {
text: 'Git',
showChevron: true
},
{
onPressCallback: () => openWebLink(links.bugs),
icon: 'bug',
text: i18n.t('aboutScreen.bugs'),
showChevron: true
},
{
onPressCallback: () => openWebLink(links.changelog),
icon: 'refresh',
@ -199,10 +213,59 @@ export default class AboutScreen extends React.Component<Props, State> {
AsyncStorageManager.getInstance().savePref(key, '1');
}
getBugReportModal() {
return (
<Modalize ref={this.modalRef}
adjustToContentHeight
modalStyle={{backgroundColor: ThemeManager.getCurrentThemeVariables().containerBgColor}}>
<View style={{
flex: 1,
padding: 20
}}>
<H1>{i18n.t('aboutScreen.bugs')}</H1>
<Text>
{i18n.t('aboutScreen.bugsDescription')}
</Text>
<Button
style={{
marginTop: 20,
marginLeft: 'auto',
marginRight: 'auto',
}}
onPress={() => openWebLink(links.bugsMail)}>
<CustomMaterialIcon
icon={'email'}
color={'#fff'}/>
<Text>{i18n.t('aboutScreen.bugsMail')}</Text>
</Button>
<Button
style={{
marginTop: 20,
marginLeft: 'auto',
marginRight: 'auto',
}}
onPress={() => openWebLink(links.bugsGit)}>
<CustomMaterialIcon
icon={'git'}
color={'#fff'}/>
<Text>{i18n.t('aboutScreen.bugsGit')}</Text>
</Button>
</View>
</Modalize>
);
}
openBugReportModal() {
if (this.modalRef.current) {
this.modalRef.current.open();
}
}
render() {
const nav = this.props.navigation;
return (
<Container>
{this.getBugReportModal()}
<CustomHeader navigation={nav} title={i18n.t('screens.about')} hasBackButton={true}/>
<Content padder>
<Card>

View file

@ -69,8 +69,10 @@
"aboutScreen": {
"appstore": "See on the Appstore",
"playstore": "See on the Playstore",
"expoBeta": "Participate in the Beta!",
"bugs": "Report Bugs",
"bugsDescription": "Reporting bugs helps us make the app better. Please be as precise as possible when describing your problem!",
"bugsMail": "Send a Mail",
"bugsGit": "Open an issue on Git",
"changelog": "Changelog",
"license": "License",
"debug": "Debug",
@ -119,7 +121,6 @@
"dryerTips": "The advised dryer length is 35 minutes for 14 kg of laundry. You can choose a shorter length if the dryer is not fully charged.",
"procedure": "Procedure",
"tips": "Tips",
"modal": {
"enableNotifications": "Notify me",
"disableNotifications": "Stop notifications",

View file

@ -69,8 +69,10 @@
"aboutScreen": {
"appstore": "Voir sur l'Appstore",
"playstore": "Voir sur le Playstore",
"expoBeta": "Participer à la Beta !",
"bugs": "Rapporter des Bugs",
"bugsDescription": "Rapporter les bugs nous aide à améliorer l'appli. Merci de décrire votre problème le plus précisément possible !",
"bugsMail": "Envoyer un Mail",
"bugsGit": "Ouvrir un ticket sur Git",
"changelog": "Historique des modifications",
"license": "Licence",
"debug": "Debug",