-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathContextMenuViewExample17.tsx
95 lines (91 loc) · 2.62 KB
/
ContextMenuViewExample17.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
// import * as React from 'react';
import { Alert } from 'react-native';
import { ContextMenuView } from 'react-native-ios-context-menu';
import type { ExampleItemProps } from './SharedExampleTypes';
import { ContextMenuCard } from '../components/ContextMenuCard';
export function ContextMenuViewExample17(props: ExampleItemProps) {
return (
<ContextMenuView
style={props.style}
menuConfig={{
menuTitle: 'ContextMenuViewExample17',
menuItems: [{
actionKey : 'key-01',
actionTitle: 'Action #1',
discoverabilityTitle: 'Blue Icon',
icon: {
type: 'IMAGE_SYSTEM',
imageValue: {
systemName: 'cloud.heavyrain.fill',
},
// blue icon
imageOptions: {
tint: 'blue',
renderingMode: 'alwaysOriginal',
},
},
}, {
actionKey : 'key-02',
actionTitle: 'Action #2',
discoverabilityTitle: 'Orange Icon',
icon: {
type: 'IMAGE_SYSTEM',
imageValue: {
systemName: 'exclamationmark.triangle.fill',
},
// orange icon
imageOptions: {
tint: 'rgb(218,165,32)',
renderingMode: 'alwaysOriginal',
},
},
}, {
actionKey : 'key-03',
actionTitle: 'Action #3',
discoverabilityTitle: 'Pink Icon',
icon: {
type: 'IMAGE_SYSTEM',
imageValue: {
systemName: 'heart.fill',
},
// pink icon
imageOptions: {
tint: '#FF1493',
renderingMode: 'alwaysOriginal',
},
},
}, {
actionKey : 'key-04',
actionTitle: 'Action #4',
discoverabilityTitle: 'Green Icon',
icon: {
type: 'IMAGE_SYSTEM',
imageValue: {
systemName: 'bubble.right.fill',
},
// green icon
imageOptions: {
tint: 'rgba(124,252,0,0.5)',
renderingMode: 'alwaysOriginal',
},
},
}]
}}
onPressMenuItem={({nativeEvent}) => {
Alert.alert(
'onPressMenuItem Event',
`actionKey: ${nativeEvent.actionKey} - actionTitle: ${nativeEvent.actionTitle}`
);
}}
>
<ContextMenuCard
index={props.index}
title={'ContextMenuViewExample17'}
subtitle={'Icon colors'}
description={[
`Context menu icon colors example`
]}
/>
</ContextMenuView>
);
};