|
@@ -5,23 +5,12 @@ import {FlatList, Linking, Platform, View} from 'react-native';
|
5
|
5
|
import i18n from "i18n-js";
|
6
|
6
|
import appJson from '../../../app';
|
7
|
7
|
import AsyncStorageManager from "../../managers/AsyncStorageManager";
|
8
|
|
-import CustomModal from "../../components/Overrides/CustomModal";
|
9
|
|
-import {Avatar, Button, Card, List, Text, Title, withTheme} from 'react-native-paper';
|
|
8
|
+import {Avatar, Card, List, Title, withTheme} from 'react-native-paper';
|
10
|
9
|
|
11
|
10
|
const links = {
|
12
|
11
|
appstore: 'https://apps.apple.com/us/app/campus-amicale-insat/id1477722148',
|
13
|
12
|
playstore: 'https://play.google.com/store/apps/details?id=fr.amicaleinsat.application',
|
14
|
13
|
git: 'https://git.etud.insa-toulouse.fr/vergnet/application-amicale/src/branch/master/README.md',
|
15
|
|
- bugsMail: 'mailto:vergnet@etud.insa-toulouse.fr?' +
|
16
|
|
- 'subject=' +
|
17
|
|
- '[BUG] Application Amicale INSA Toulouse' +
|
18
|
|
- '&body=' +
|
19
|
|
- 'Coucou Arnaud ça bug c\'est nul,\n\n' +
|
20
|
|
- 'Informations sur ton système si tu sais (iOS ou Android, modèle du tel, version):\n\n\n' +
|
21
|
|
- 'Nature du problème :\n\n\n' +
|
22
|
|
- 'Étapes pour reproduire ce pb :\n\n\n\n' +
|
23
|
|
- 'Stp corrige le pb, bien cordialement.',
|
24
|
|
- bugsGit: 'https://git.etud.insa-toulouse.fr/vergnet/application-amicale/issues',
|
25
|
14
|
changelog: 'https://git.etud.insa-toulouse.fr/vergnet/application-amicale/src/branch/master/Changelog.md',
|
26
|
15
|
license: 'https://git.etud.insa-toulouse.fr/vergnet/application-amicale/src/branch/master/LICENSE',
|
27
|
16
|
authorMail: "mailto:vergnet@etud.insa-toulouse.fr?" +
|
|
@@ -78,9 +67,9 @@ class AboutScreen extends React.Component<Props, State> {
|
78
|
67
|
showChevron: true
|
79
|
68
|
},
|
80
|
69
|
{
|
81
|
|
- onPressCallback: () => this.openBugReportModal(),
|
|
70
|
+ onPressCallback: () => this.props.navigation.navigate("feedback"),
|
82
|
71
|
icon: 'bug',
|
83
|
|
- text: i18n.t('aboutScreen.bugs'),
|
|
72
|
+ text: i18n.t('screens.feedback'),
|
84
|
73
|
showChevron: true
|
85
|
74
|
},
|
86
|
75
|
{
|
|
@@ -193,21 +182,11 @@ class AboutScreen extends React.Component<Props, State> {
|
193
|
182
|
},
|
194
|
183
|
];
|
195
|
184
|
|
196
|
|
- getCardItem: Function;
|
197
|
|
- getMainCard: Function;
|
198
|
|
- onModalRef: Function;
|
199
|
|
- onPressMail: Function;
|
200
|
|
- onPressGit: Function;
|
201
|
185
|
|
202
|
186
|
colors: Object;
|
203
|
187
|
|
204
|
188
|
constructor(props) {
|
205
|
189
|
super(props);
|
206
|
|
- this.getCardItem = this.getCardItem.bind(this);
|
207
|
|
- this.getMainCard = this.getMainCard.bind(this);
|
208
|
|
- this.onModalRef = this.onModalRef.bind(this);
|
209
|
|
- this.onPressMail = openWebLink.bind(this, links.bugsMail);
|
210
|
|
- this.onPressGit = openWebLink.bind(this, links.bugsGit);
|
211
|
190
|
this.colors = props.theme.colors;
|
212
|
191
|
}
|
213
|
192
|
|
|
@@ -340,7 +319,7 @@ class AboutScreen extends React.Component<Props, State> {
|
340
|
319
|
*
|
341
|
320
|
* @returns {*}
|
342
|
321
|
*/
|
343
|
|
- getCardItem({item}: Object) {
|
|
322
|
+ getCardItem = ({item}: Object) => {
|
344
|
323
|
let shouldShow = item === undefined
|
345
|
324
|
|| !item.showOnlyInDebug
|
346
|
325
|
|| (item.showOnlyInDebug && this.state.isDebugUnlocked);
|
|
@@ -366,7 +345,7 @@ class AboutScreen extends React.Component<Props, State> {
|
366
|
345
|
}
|
367
|
346
|
} else
|
368
|
347
|
return null;
|
369
|
|
- }
|
|
348
|
+ };
|
370
|
349
|
|
371
|
350
|
/**
|
372
|
351
|
* Tries to unlock debug mode
|
|
@@ -388,62 +367,12 @@ class AboutScreen extends React.Component<Props, State> {
|
388
|
367
|
}
|
389
|
368
|
|
390
|
369
|
/**
|
391
|
|
- * Gets the bug report modal's content
|
392
|
|
- *
|
393
|
|
- * @return {*}
|
394
|
|
- */
|
395
|
|
- getBugReportModal() {
|
396
|
|
- return (
|
397
|
|
- <View style={{
|
398
|
|
- flex: 1,
|
399
|
|
- padding: 20
|
400
|
|
- }}>
|
401
|
|
- <Title>{i18n.t('aboutScreen.bugs')}</Title>
|
402
|
|
- <Text>
|
403
|
|
- {i18n.t('aboutScreen.bugsDescription')}
|
404
|
|
- </Text>
|
405
|
|
- <Button
|
406
|
|
- icon="email"
|
407
|
|
- mode="contained"
|
408
|
|
- style={{
|
409
|
|
- marginTop: 20,
|
410
|
|
- marginLeft: 'auto',
|
411
|
|
- marginRight: 'auto',
|
412
|
|
- }}
|
413
|
|
- onPress={this.onPressMail}>
|
414
|
|
- {i18n.t('aboutScreen.bugsMail')}
|
415
|
|
- </Button>
|
416
|
|
- <Button
|
417
|
|
- icon="git"
|
418
|
|
- mode="contained"
|
419
|
|
- style={{
|
420
|
|
- marginTop: 20,
|
421
|
|
- marginLeft: 'auto',
|
422
|
|
- marginRight: 'auto',
|
423
|
|
- }}
|
424
|
|
- onPress={this.onPressGit}>
|
425
|
|
- {i18n.t('aboutScreen.bugsGit')}
|
426
|
|
- </Button>
|
427
|
|
- </View>
|
428
|
|
- );
|
429
|
|
- }
|
430
|
|
-
|
431
|
|
- /**
|
432
|
|
- * opens the bug report modal
|
433
|
|
- */
|
434
|
|
- openBugReportModal() {
|
435
|
|
- if (this.modalRef) {
|
436
|
|
- this.modalRef.open();
|
437
|
|
- }
|
438
|
|
- }
|
439
|
|
-
|
440
|
|
- /**
|
441
|
370
|
* Gets a card, depending on the given item's id
|
442
|
371
|
*
|
443
|
372
|
* @param item The item to show
|
444
|
373
|
* @return {*}
|
445
|
374
|
*/
|
446
|
|
- getMainCard({item}: Object) {
|
|
375
|
+ getMainCard = ({item}: Object) => {
|
447
|
376
|
switch (item.id) {
|
448
|
377
|
case 'app':
|
449
|
378
|
return this.getAppCard();
|
|
@@ -453,29 +382,15 @@ class AboutScreen extends React.Component<Props, State> {
|
453
|
382
|
return this.getTechnoCard();
|
454
|
383
|
}
|
455
|
384
|
return <View/>;
|
456
|
|
- }
|
457
|
|
-
|
458
|
|
- /**
|
459
|
|
- * Callback used when receiving the modal ref
|
460
|
|
- *
|
461
|
|
- * @param ref
|
462
|
|
- */
|
463
|
|
- onModalRef(ref: Object) {
|
464
|
|
- this.modalRef = ref;
|
465
|
|
- }
|
|
385
|
+ };
|
466
|
386
|
|
467
|
387
|
render() {
|
468
|
388
|
return (
|
469
|
|
- <View style={{padding: 5}}>
|
470
|
|
- <CustomModal onRef={this.onModalRef}>
|
471
|
|
- {this.getBugReportModal()}
|
472
|
|
- </CustomModal>
|
473
|
|
- <FlatList
|
474
|
|
- style={{padding: 5}}
|
475
|
|
- data={this.dataOrder}
|
476
|
|
- renderItem={this.getMainCard}
|
477
|
|
- />
|
478
|
|
- </View>
|
|
389
|
+ <FlatList
|
|
390
|
+ style={{padding: 5}}
|
|
391
|
+ data={this.dataOrder}
|
|
392
|
+ renderItem={this.getMainCard}
|
|
393
|
+ />
|
479
|
394
|
);
|
480
|
395
|
}
|
481
|
396
|
}
|