|
@@ -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>
|