Browse Source

Added mail contact for bug reports

keplyx 2 years ago
parent
commit
e2f74b97e6
3 changed files with 86 additions and 20 deletions
  1. 76
    13
      screens/About/AboutScreen.js
  2. 7
    6
      translations/en.json
  3. 3
    1
      translations/fr.json

+ 76
- 13
screens/About/AboutScreen.js View File

@@ -2,23 +2,37 @@
2 2
 
3 3
 import * as React from 'react';
4 4
 import {FlatList, Linking, Platform, View} from 'react-native';
5
-import {Body, Card, CardItem, Container, Content, H1, Left, Right, Text, Thumbnail} from 'native-base';
5
+import {Body, Card, CardItem, Container, Content, H1, Left, Right, Text, Thumbnail, Button} from 'native-base';
6 6
 import CustomHeader from "../../components/CustomHeader";
7 7
 import i18n from "i18n-js";
8 8
 import appJson from '../../app';
9 9
 import packageJson from '../../package';
10 10
 import CustomMaterialIcon from "../../components/CustomMaterialIcon";
11 11
 import AsyncStorageManager from "../../utils/AsyncStorageManager";
12
+import Modalize from "react-native-modalize";
13
+import ThemeManager from "../../utils/ThemeManager";
12 14
 
13 15
 const links = {
14 16
     appstore: 'https://apps.apple.com/us/app/campus-amicale-insat/id1477722148',
15 17
     playstore: 'https://play.google.com/store/apps/details?id=fr.amicaleinsat.application',
16
-    expo: 'https://expo.io/@amicaleinsat/application-amicale',
17 18
     git: 'https://git.srv-falcon.etud.insa-toulouse.fr/vergnet/application-amicale/src/branch/master/README.md',
18
-    bugs: 'https://git.srv-falcon.etud.insa-toulouse.fr/vergnet/application-amicale/issues',
19
+    bugsMail: 'mailto:vergnet@etud.insa-toulouse.fr?' +
20
+        'subject=' +
21
+        '[BUG] Application Amicale INSA Toulouse' +
22
+        '&body=' +
23
+        'Coucou Arnaud ça bug c\'est nul,\n\n' +
24
+        'Informations sur ton système si tu sais (iOS ou Android, modèle du tel, version):\n\n\n' +
25
+        'Nature du problème :\n\n\n' +
26
+        'Étapes pour reproduire ce pb :\n\n\n\n' +
27
+        'Stp corrige le pb, bien cordialement.',
28
+    bugsGit: 'https://git.srv-falcon.etud.insa-toulouse.fr/vergnet/application-amicale/issues',
19 29
     changelog: 'https://git.srv-falcon.etud.insa-toulouse.fr/vergnet/application-amicale/src/branch/master/Changelog.md',
20 30
     license: 'https://git.srv-falcon.etud.insa-toulouse.fr/vergnet/application-amicale/src/branch/master/LICENSE',
21
-    mail: "mailto:vergnet@etud.insa-toulouse.fr?subject=Application Amicale INSA Toulouse&body=",
31
+    mail: "mailto:vergnet@etud.insa-toulouse.fr?" +
32
+        "subject=" +
33
+        "Application Amicale INSA Toulouse" +
34
+        "&body=" +
35
+        "Coucou !\n\n",
22 36
     linkedin: 'https://www.linkedin.com/in/arnaud-vergnet-434ba5179/',
23 37
     facebook: 'https://www.facebook.com/arnaud.vergnet',
24 38
     react: 'https://facebook.github.io/react-native/',
@@ -46,11 +60,17 @@ function openWebLink(link) {
46 60
 export default class AboutScreen extends React.Component<Props, State> {
47 61
 
48 62
     debugTapCounter = 0;
63
+    modalRef: { current: null | Modalize };
49 64
 
50 65
     state = {
51 66
         isDebugUnlocked: AsyncStorageManager.getInstance().preferences.debugUnlocked.current === '1'
52 67
     };
53 68
 
69
+    constructor(props: any) {
70
+        super(props);
71
+        this.modalRef = React.createRef();
72
+    }
73
+
54 74
     /**
55 75
      * Data to be displayed in the app card
56 76
      */
@@ -62,9 +82,9 @@ export default class AboutScreen extends React.Component<Props, State> {
62 82
             showChevron: true
63 83
         },
64 84
         {
65
-            onPressCallback: () => openWebLink(links.expo),
66
-            icon: 'worker',
67
-            text: i18n.t('aboutScreen.expoBeta'),
85
+            onPressCallback: () => this.openBugReportModal(),
86
+            icon: 'bug',
87
+            text: i18n.t('aboutScreen.bugs'),
68 88
             showChevron: true
69 89
         },
70 90
         {
@@ -74,12 +94,6 @@ export default class AboutScreen extends React.Component<Props, State> {
74 94
             showChevron: true
75 95
         },
76 96
         {
77
-            onPressCallback: () => openWebLink(links.bugs),
78
-            icon: 'bug',
79
-            text: i18n.t('aboutScreen.bugs'),
80
-            showChevron: true
81
-        },
82
-        {
83 97
             onPressCallback: () => openWebLink(links.changelog),
84 98
             icon: 'refresh',
85 99
             text: i18n.t('aboutScreen.changelog'),
@@ -199,10 +213,59 @@ export default class AboutScreen extends React.Component<Props, State> {
199 213
         AsyncStorageManager.getInstance().savePref(key, '1');
200 214
     }
201 215
 
216
+    getBugReportModal() {
217
+        return (
218
+            <Modalize ref={this.modalRef}
219
+                      adjustToContentHeight
220
+                      modalStyle={{backgroundColor: ThemeManager.getCurrentThemeVariables().containerBgColor}}>
221
+                <View style={{
222
+                    flex: 1,
223
+                    padding: 20
224
+                }}>
225
+                    <H1>{i18n.t('aboutScreen.bugs')}</H1>
226
+                    <Text>
227
+                        {i18n.t('aboutScreen.bugsDescription')}
228
+                    </Text>
229
+                    <Button
230
+                        style={{
231
+                            marginTop: 20,
232
+                            marginLeft: 'auto',
233
+                            marginRight: 'auto',
234
+                        }}
235
+                        onPress={() => openWebLink(links.bugsMail)}>
236
+                        <CustomMaterialIcon
237
+                            icon={'email'}
238
+                            color={'#fff'}/>
239
+                        <Text>{i18n.t('aboutScreen.bugsMail')}</Text>
240
+                    </Button>
241
+                    <Button
242
+                        style={{
243
+                            marginTop: 20,
244
+                            marginLeft: 'auto',
245
+                            marginRight: 'auto',
246
+                        }}
247
+                        onPress={() => openWebLink(links.bugsGit)}>
248
+                        <CustomMaterialIcon
249
+                            icon={'git'}
250
+                            color={'#fff'}/>
251
+                        <Text>{i18n.t('aboutScreen.bugsGit')}</Text>
252
+                    </Button>
253
+                </View>
254
+            </Modalize>
255
+        );
256
+    }
257
+
258
+    openBugReportModal() {
259
+        if (this.modalRef.current) {
260
+            this.modalRef.current.open();
261
+        }
262
+    }
263
+
202 264
     render() {
203 265
         const nav = this.props.navigation;
204 266
         return (
205 267
             <Container>
268
+                {this.getBugReportModal()}
206 269
                 <CustomHeader navigation={nav} title={i18n.t('screens.about')} hasBackButton={true}/>
207 270
                 <Content padder>
208 271
                     <Card>

+ 7
- 6
translations/en.json View File

@@ -69,8 +69,10 @@
69 69
   "aboutScreen": {
70 70
     "appstore": "See on the Appstore",
71 71
     "playstore": "See on the Playstore",
72
-    "expoBeta": "Participate in the Beta!",
73 72
     "bugs": "Report Bugs",
73
+    "bugsDescription": "Reporting bugs helps us make the app better. Please be as precise as possible when describing your problem!",
74
+    "bugsMail": "Send a Mail",
75
+    "bugsGit": "Open an issue on Git",
74 76
     "changelog": "Changelog",
75 77
     "license": "License",
76 78
     "debug": "Debug",
@@ -92,8 +94,8 @@
92 94
     "inStock": "in stock",
93 95
     "description": "The Proximo is your small grocery store maintained by students directly on the campus. Open every day from 18h30 to 19h30, we welcome you when you are short on pastas or sodas ! Different products for different problems, everything at cost price. You can pay by Lydia or cash.",
94 96
     "openingHours": "Openning Hours",
95
-    "paymentMethods" : "Payment Methods",
96
-    "paymentMethodsDescription" : "Cash or Lydia"
97
+    "paymentMethods": "Payment Methods",
98
+    "paymentMethodsDescription": "Cash or Lydia"
97 99
   },
98 100
   "proxiwashScreen": {
99 101
     "dryer": "Dryer",
@@ -107,19 +109,18 @@
107 109
     "loading": "Loading...",
108 110
     "description": "This is the washing service operated by Promologis for INSA's residences (We don't mind if you do not live on the campus and you do your laundry here). The room is right next to the R2, with 3 dryers and 9 washers, is open 7d/7 24h/24 ! Here you can check their availability ! You can bring your own detergent, use the one given on site or buy it at the Proximo (cheaper than the one given by the machines ). You can pay b credit card or cash.",
109 111
     "informationTab": "Information",
110
-    "paymentTab" : "Payment",
112
+    "paymentTab": "Payment",
111 113
     "tariffs": "Tariffs",
112 114
     "washersTariff": "3€ the washer + 0.80€ with detergent.",
113 115
     "dryersTariff": "0.35€ for 5min of dryer usage.",
114 116
     "paymentMethods": "Payment Methods",
115
-    "paymentMethodsDescription" : "Cash up until 10€.\nCredit Card also accepted.",
117
+    "paymentMethodsDescription": "Cash up until 10€.\nCredit Card also accepted.",
116 118
     "washerProcedure": "Put your laundry in the tumble without tamping it and by respecting charge limits.\n\nClose the machine's door.\n\nChoose a program using one of the four favorite program buttons.\n\nPay to the command central, then press the START button on the machine.\n\nWhen the program is finished, the screen indicates 'Programme terminé', press the yellow button to open the lid and retrieve your laundry.",
117 119
     "washerTips": "Program 'blanc/couleur': 6kg of dry laundry (cotton linen, linen, underwear, sheets, jeans, towels).\n\nProgram 'non repassable': 3,5 kg of dry laundry (synthetic fibre linen, cotton and polyester mixed).\n\nProgram 'fin 30°C': 2,5 kg of dry laundry (delicate linen in synthetic fibres).\n\nProgram 'laine 30°C': 2,5 kg of dry laundry (wool textiles).",
118 120
     "dryerProcedure": "Put your laundry in the tumble without tamping it and by respecting charge limits.\n\nClose the machine's door.\n\nChoose a program using one of the four favorite program buttons.\n\nPay to the command central, then press the START button on the machine.",
119 121
     "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.",
120 122
     "procedure": "Procedure",
121 123
     "tips": "Tips",
122
-
123 124
     "modal": {
124 125
       "enableNotifications": "Notify me",
125 126
       "disableNotifications": "Stop notifications",

+ 3
- 1
translations/fr.json View File

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

Loading…
Cancel
Save