|
@@ -6,6 +6,7 @@ import {FlatList} from 'react-native';
|
6
|
6
|
|
7
|
7
|
export type OptionsDialogButtonType = {
|
8
|
8
|
title: string,
|
|
9
|
+ icon?: string,
|
9
|
10
|
onPress: () => void,
|
10
|
11
|
};
|
11
|
12
|
|
|
@@ -19,10 +20,19 @@ type PropsType = {
|
19
|
20
|
|
20
|
21
|
class OptionsDialog extends React.PureComponent<PropsType> {
|
21
|
22
|
getButtonRender = ({item}: {item: OptionsDialogButtonType}): React.Node => {
|
22
|
|
- return <Button onPress={item.onPress}>{item.title}</Button>;
|
|
23
|
+ return (
|
|
24
|
+ <Button onPress={item.onPress} icon={item.icon}>
|
|
25
|
+ {item.title}
|
|
26
|
+ </Button>
|
|
27
|
+ );
|
23
|
28
|
};
|
24
|
29
|
|
25
|
|
- keyExtractor = (item: OptionsDialogButtonType): string => item.title;
|
|
30
|
+ keyExtractor = (item: OptionsDialogButtonType): string => {
|
|
31
|
+ if (item.icon != null) {
|
|
32
|
+ return item.title + item.icon;
|
|
33
|
+ }
|
|
34
|
+ return item.title;
|
|
35
|
+ };
|
26
|
36
|
|
27
|
37
|
render(): React.Node {
|
28
|
38
|
const {props} = this;
|