|
@@ -186,33 +186,47 @@ class AboutScreen extends React.Component<Props, State> {
|
186
|
186
|
getCardItem: Function;
|
187
|
187
|
getMainCard: Function;
|
188
|
188
|
onModalRef: Function;
|
|
189
|
+ onPressMail: Function;
|
|
190
|
+ onPressGit: Function;
|
189
|
191
|
|
190
|
|
- colors: object;
|
|
192
|
+ colors: Object;
|
191
|
193
|
|
192
|
194
|
constructor(props) {
|
193
|
195
|
super(props);
|
194
|
196
|
this.getCardItem = this.getCardItem.bind(this);
|
195
|
197
|
this.getMainCard = this.getMainCard.bind(this);
|
196
|
198
|
this.onModalRef = this.onModalRef.bind(this);
|
|
199
|
+ this.onPressMail = openWebLink.bind(this, links.bugsMail);
|
|
200
|
+ this.onPressGit = openWebLink.bind(this, links.bugsGit);
|
197
|
201
|
this.colors = props.theme.colors;
|
198
|
202
|
}
|
199
|
203
|
|
|
204
|
+ getAppIcon(props) {
|
|
205
|
+ return (
|
|
206
|
+ <Avatar.Image
|
|
207
|
+ {...props}
|
|
208
|
+ source={require('../../assets/android.icon.png')}
|
|
209
|
+ style={{backgroundColor: 'transparent'}}
|
|
210
|
+ />
|
|
211
|
+ );
|
|
212
|
+ }
|
|
213
|
+
|
|
214
|
+ keyExtractor(item: Object) {
|
|
215
|
+ return item.icon;
|
|
216
|
+ }
|
|
217
|
+
|
200
|
218
|
getAppCard() {
|
201
|
219
|
return (
|
202
|
220
|
<Card style={{marginBottom: 10}}>
|
203
|
221
|
<Card.Title
|
204
|
222
|
title={appJson.expo.name}
|
205
|
223
|
subtitle={appJson.expo.version}
|
206
|
|
- left={(props) => <Avatar.Image
|
207
|
|
- {...props}
|
208
|
|
- source={require('../../assets/android.icon.png')}
|
209
|
|
- style={{backgroundColor: 'transparent'}}
|
210
|
|
- />}/>
|
|
224
|
+ left={this.getAppIcon}/>
|
211
|
225
|
<Card.Content>
|
212
|
226
|
<FlatList
|
213
|
227
|
data={this.appData}
|
214
|
228
|
extraData={this.state}
|
215
|
|
- keyExtractor={(item) => item.icon}
|
|
229
|
+ keyExtractor={this.keyExtractor}
|
216
|
230
|
listKey={"app"}
|
217
|
231
|
renderItem={this.getCardItem}
|
218
|
232
|
/>
|
|
@@ -232,7 +246,7 @@ class AboutScreen extends React.Component<Props, State> {
|
232
|
246
|
<FlatList
|
233
|
247
|
data={this.authorData}
|
234
|
248
|
extraData={this.state}
|
235
|
|
- keyExtractor={(item) => item.icon}
|
|
249
|
+ keyExtractor={this.keyExtractor}
|
236
|
250
|
listKey={"team1"}
|
237
|
251
|
renderItem={this.getCardItem}
|
238
|
252
|
/>
|
|
@@ -240,7 +254,7 @@ class AboutScreen extends React.Component<Props, State> {
|
240
|
254
|
<FlatList
|
241
|
255
|
data={this.additionalDevData}
|
242
|
256
|
extraData={this.state}
|
243
|
|
- keyExtractor={(item) => item.icon}
|
|
257
|
+ keyExtractor={this.keyExtractor}
|
244
|
258
|
listKey={"team2"}
|
245
|
259
|
renderItem={this.getCardItem}
|
246
|
260
|
/>
|
|
@@ -257,7 +271,7 @@ class AboutScreen extends React.Component<Props, State> {
|
257
|
271
|
<FlatList
|
258
|
272
|
data={this.technoData}
|
259
|
273
|
extraData={this.state}
|
260
|
|
- keyExtractor={(item) => item.icon}
|
|
274
|
+ keyExtractor={this.keyExtractor}
|
261
|
275
|
listKey={"techno"}
|
262
|
276
|
renderItem={this.getCardItem}
|
263
|
277
|
/>
|
|
@@ -266,6 +280,18 @@ class AboutScreen extends React.Component<Props, State> {
|
266
|
280
|
);
|
267
|
281
|
}
|
268
|
282
|
|
|
283
|
+ getChevronIcon(props: Object) {
|
|
284
|
+ return (
|
|
285
|
+ <List.Icon {...props} icon={'chevron-right'}/>
|
|
286
|
+ );
|
|
287
|
+ }
|
|
288
|
+
|
|
289
|
+ getItemIcon(item: Object, props: Object) {
|
|
290
|
+ return (
|
|
291
|
+ <List.Icon {...props} icon={item.icon}/>
|
|
292
|
+ );
|
|
293
|
+ }
|
|
294
|
+
|
269
|
295
|
/**
|
270
|
296
|
* Get a clickable card item to be rendered inside a card.
|
271
|
297
|
*
|
|
@@ -273,13 +299,14 @@ class AboutScreen extends React.Component<Props, State> {
|
273
|
299
|
*/
|
274
|
300
|
getCardItem({item}: Object) {
|
275
|
301
|
let shouldShow = !item.showOnlyInDebug || (item.showOnlyInDebug && this.state.isDebugUnlocked);
|
|
302
|
+ const getItemIcon = this.getItemIcon.bind(this, item);
|
276
|
303
|
if (shouldShow) {
|
277
|
304
|
if (item.showChevron) {
|
278
|
305
|
return (
|
279
|
306
|
<List.Item
|
280
|
307
|
title={item.text}
|
281
|
|
- left={props => <List.Icon {...props} icon={item.icon}/>}
|
282
|
|
- right={props => <List.Icon {...props} icon={'chevron-right'}/>}
|
|
308
|
+ left={getItemIcon}
|
|
309
|
+ right={this.getChevronIcon}
|
283
|
310
|
onPress={item.onPressCallback}
|
284
|
311
|
/>
|
285
|
312
|
);
|
|
@@ -287,16 +314,13 @@ class AboutScreen extends React.Component<Props, State> {
|
287
|
314
|
return (
|
288
|
315
|
<List.Item
|
289
|
316
|
title={item.text}
|
290
|
|
- left={props => <List.Icon {...props} icon={item.icon}/>}
|
|
317
|
+ left={getItemIcon}
|
291
|
318
|
onPress={item.onPressCallback}
|
292
|
319
|
/>
|
293
|
320
|
);
|
294
|
321
|
}
|
295
|
|
-
|
296
|
|
- } else {
|
|
322
|
+ } else
|
297
|
323
|
return null;
|
298
|
|
- }
|
299
|
|
-
|
300
|
324
|
}
|
301
|
325
|
|
302
|
326
|
tryUnlockDebugMode() {
|
|
@@ -313,8 +337,6 @@ class AboutScreen extends React.Component<Props, State> {
|
313
|
337
|
}
|
314
|
338
|
|
315
|
339
|
getBugReportModal() {
|
316
|
|
- const onPressMail = openWebLink.bind(this, links.bugsMail);
|
317
|
|
- const onPressGit = openWebLink.bind(this, links.bugsGit);
|
318
|
340
|
return (
|
319
|
341
|
<View style={{
|
320
|
342
|
flex: 1,
|
|
@@ -334,7 +356,7 @@ class AboutScreen extends React.Component<Props, State> {
|
334
|
356
|
marginLeft: 'auto',
|
335
|
357
|
marginRight: 'auto',
|
336
|
358
|
}}
|
337
|
|
- onPress={onPressMail}>
|
|
359
|
+ onPress={this.onPressMail}>
|
338
|
360
|
<Text>{i18n.t('aboutScreen.bugsMail')}</Text>
|
339
|
361
|
</Button>
|
340
|
362
|
<Button
|
|
@@ -347,7 +369,7 @@ class AboutScreen extends React.Component<Props, State> {
|
347
|
369
|
marginLeft: 'auto',
|
348
|
370
|
marginRight: 'auto',
|
349
|
371
|
}}
|
350
|
|
- onPress={onPressGit}>
|
|
372
|
+ onPress={this.onPressGit}>
|
351
|
373
|
<Text>{i18n.t('aboutScreen.bugsGit')}</Text>
|
352
|
374
|
</Button>
|
353
|
375
|
</View>
|