|
@@ -105,7 +105,7 @@ class AboutScreen extends React.Component<Props, State> {
|
105
|
105
|
icon: 'bug-check',
|
106
|
106
|
text: i18n.t('aboutScreen.debug'),
|
107
|
107
|
showChevron: true,
|
108
|
|
- showOnlyDebug: true
|
|
108
|
+ showOnlyInDebug: true
|
109
|
109
|
},
|
110
|
110
|
];
|
111
|
111
|
/**
|
|
@@ -171,6 +171,9 @@ class AboutScreen extends React.Component<Props, State> {
|
171
|
171
|
showChevron: true
|
172
|
172
|
},
|
173
|
173
|
];
|
|
174
|
+ /**
|
|
175
|
+ * Order of information cards
|
|
176
|
+ */
|
174
|
177
|
dataOrder: Array<Object> = [
|
175
|
178
|
{
|
176
|
179
|
id: 'app',
|
|
@@ -201,6 +204,11 @@ class AboutScreen extends React.Component<Props, State> {
|
201
|
204
|
this.colors = props.theme.colors;
|
202
|
205
|
}
|
203
|
206
|
|
|
207
|
+ /**
|
|
208
|
+ * Gets the app icon
|
|
209
|
+ * @param props
|
|
210
|
+ * @return {*}
|
|
211
|
+ */
|
204
|
212
|
getAppIcon(props) {
|
205
|
213
|
return (
|
206
|
214
|
<Avatar.Image
|
|
@@ -211,10 +219,21 @@ class AboutScreen extends React.Component<Props, State> {
|
211
|
219
|
);
|
212
|
220
|
}
|
213
|
221
|
|
214
|
|
- keyExtractor(item: Object) {
|
|
222
|
+ /**
|
|
223
|
+ * Extracts a key from the given item
|
|
224
|
+ *
|
|
225
|
+ * @param item The item to extract the key from
|
|
226
|
+ * @return {string} The extracted key
|
|
227
|
+ */
|
|
228
|
+ keyExtractor(item: Object): string {
|
215
|
229
|
return item.icon;
|
216
|
230
|
}
|
217
|
231
|
|
|
232
|
+ /**
|
|
233
|
+ * Gets the app card showing information and links about the app.
|
|
234
|
+ *
|
|
235
|
+ * @return {*}
|
|
236
|
+ */
|
218
|
237
|
getAppCard() {
|
219
|
238
|
return (
|
220
|
239
|
<Card style={{marginBottom: 10}}>
|
|
@@ -235,6 +254,11 @@ class AboutScreen extends React.Component<Props, State> {
|
235
|
254
|
);
|
236
|
255
|
}
|
237
|
256
|
|
|
257
|
+ /**
|
|
258
|
+ * Gets the team card showing information and links about the team
|
|
259
|
+ *
|
|
260
|
+ * @return {*}
|
|
261
|
+ */
|
238
|
262
|
getTeamCard() {
|
239
|
263
|
return (
|
240
|
264
|
<Card style={{marginBottom: 10}}>
|
|
@@ -263,6 +287,11 @@ class AboutScreen extends React.Component<Props, State> {
|
263
|
287
|
);
|
264
|
288
|
}
|
265
|
289
|
|
|
290
|
+ /**
|
|
291
|
+ * Gets the techno card showing information and links about the technologies used in the app
|
|
292
|
+ *
|
|
293
|
+ * @return {*}
|
|
294
|
+ */
|
266
|
295
|
getTechnoCard() {
|
267
|
296
|
return (
|
268
|
297
|
<Card style={{marginBottom: 10}}>
|
|
@@ -280,12 +309,25 @@ class AboutScreen extends React.Component<Props, State> {
|
280
|
309
|
);
|
281
|
310
|
}
|
282
|
311
|
|
|
312
|
+ /**
|
|
313
|
+ * Gets a chevron icon
|
|
314
|
+ *
|
|
315
|
+ * @param props
|
|
316
|
+ * @return {*}
|
|
317
|
+ */
|
283
|
318
|
getChevronIcon(props: Object) {
|
284
|
319
|
return (
|
285
|
320
|
<List.Icon {...props} icon={'chevron-right'}/>
|
286
|
321
|
);
|
287
|
322
|
}
|
288
|
323
|
|
|
324
|
+ /**
|
|
325
|
+ * Gets a custom list item icon
|
|
326
|
+ *
|
|
327
|
+ * @param item The item to show the icon for
|
|
328
|
+ * @param props
|
|
329
|
+ * @return {*}
|
|
330
|
+ */
|
289
|
331
|
getItemIcon(item: Object, props: Object) {
|
290
|
332
|
return (
|
291
|
333
|
<List.Icon {...props} icon={item.icon}/>
|
|
@@ -295,10 +337,12 @@ class AboutScreen extends React.Component<Props, State> {
|
295
|
337
|
/**
|
296
|
338
|
* Get a clickable card item to be rendered inside a card.
|
297
|
339
|
*
|
298
|
|
- * @returns {React.Node}
|
|
340
|
+ * @returns {*}
|
299
|
341
|
*/
|
300
|
342
|
getCardItem({item}: Object) {
|
301
|
|
- let shouldShow = !item.showOnlyInDebug || (item.showOnlyInDebug && this.state.isDebugUnlocked);
|
|
343
|
+ let shouldShow = item === undefined
|
|
344
|
+ || !item.showOnlyInDebug
|
|
345
|
+ || (item.showOnlyInDebug && this.state.isDebugUnlocked);
|
302
|
346
|
const getItemIcon = this.getItemIcon.bind(this, item);
|
303
|
347
|
if (shouldShow) {
|
304
|
348
|
if (item.showChevron) {
|
|
@@ -323,6 +367,9 @@ class AboutScreen extends React.Component<Props, State> {
|
323
|
367
|
return null;
|
324
|
368
|
}
|
325
|
369
|
|
|
370
|
+ /**
|
|
371
|
+ * Tries to unlock debug mode
|
|
372
|
+ */
|
326
|
373
|
tryUnlockDebugMode() {
|
327
|
374
|
this.debugTapCounter = this.debugTapCounter + 1;
|
328
|
375
|
if (this.debugTapCounter >= 4) {
|
|
@@ -330,12 +377,20 @@ class AboutScreen extends React.Component<Props, State> {
|
330
|
377
|
}
|
331
|
378
|
}
|
332
|
379
|
|
|
380
|
+ /**
|
|
381
|
+ * Unlocks debug mode
|
|
382
|
+ */
|
333
|
383
|
unlockDebugMode() {
|
334
|
384
|
this.setState({isDebugUnlocked: true});
|
335
|
385
|
let key = AsyncStorageManager.getInstance().preferences.debugUnlocked.key;
|
336
|
386
|
AsyncStorageManager.getInstance().savePref(key, '1');
|
337
|
387
|
}
|
338
|
388
|
|
|
389
|
+ /**
|
|
390
|
+ * Gets the bug report modal's content
|
|
391
|
+ *
|
|
392
|
+ * @return {*}
|
|
393
|
+ */
|
339
|
394
|
getBugReportModal() {
|
340
|
395
|
return (
|
341
|
396
|
<View style={{
|
|
@@ -376,12 +431,21 @@ class AboutScreen extends React.Component<Props, State> {
|
376
|
431
|
);
|
377
|
432
|
}
|
378
|
433
|
|
|
434
|
+ /**
|
|
435
|
+ * opens the bug report modal
|
|
436
|
+ */
|
379
|
437
|
openBugReportModal() {
|
380
|
438
|
if (this.modalRef) {
|
381
|
439
|
this.modalRef.open();
|
382
|
440
|
}
|
383
|
441
|
}
|
384
|
442
|
|
|
443
|
+ /**
|
|
444
|
+ * Gets a card, depending on the given item's id
|
|
445
|
+ *
|
|
446
|
+ * @param item The item to show
|
|
447
|
+ * @return {*}
|
|
448
|
+ */
|
385
|
449
|
getMainCard({item}: Object) {
|
386
|
450
|
switch (item.id) {
|
387
|
451
|
case 'app':
|
|
@@ -394,6 +458,11 @@ class AboutScreen extends React.Component<Props, State> {
|
394
|
458
|
return <View/>;
|
395
|
459
|
}
|
396
|
460
|
|
|
461
|
+ /**
|
|
462
|
+ * Callback used when receiving the modal ref
|
|
463
|
+ *
|
|
464
|
+ * @param ref
|
|
465
|
+ */
|
397
|
466
|
onModalRef(ref: Object) {
|
398
|
467
|
this.modalRef = ref;
|
399
|
468
|
}
|