@react-native-menu/menu 0.5.2 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/gradle.properties +3 -3
- package/lib/commonjs/UIMenuView.android.js.map +1 -1
- package/lib/commonjs/UIMenuView.ios.js.map +1 -1
- package/lib/commonjs/UIMenuView.js.map +1 -1
- package/lib/commonjs/index.js +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/module/UIMenuView.android.js.map +1 -1
- package/lib/module/UIMenuView.ios.js.map +1 -1
- package/lib/module/UIMenuView.js.map +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/typescript/src/index.d.ts +2 -2
- package/lib/typescript/src/types.d.ts +4 -2
- package/package.json +8 -8
- package/src/index.tsx +2 -1
- package/src/types.ts +6 -2
- package/.editorconfig +0 -15
- package/.gitattributes +0 -3
- package/.github/CODEOWNERS +0 -1
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -8
- package/.github/dependabot.yml +0 -51
- package/.github/workflows/ci.yml +0 -90
- package/.gitignore +0 -60
- package/CONTRIBUTING.md +0 -184
- package/babel.config.js +0 -3
- package/example/.gitignore +0 -14
- package/example/.watchmanconfig +0 -1
- package/example/android/build.gradle +0 -14
- package/example/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/example/android/gradle/wrapper/gradle-wrapper.properties +0 -5
- package/example/android/gradle.properties +0 -6
- package/example/android/gradlew +0 -185
- package/example/android/gradlew.bat +0 -89
- package/example/android/settings.gradle +0 -12
- package/example/app.json +0 -28
- package/example/babel.config.js +0 -3
- package/example/index.tsx +0 -5
- package/example/ios/Podfile +0 -7
- package/example/ios/Podfile.lock +0 -515
- package/example/metro.config.js +0 -44
- package/example/package.json +0 -34
- package/example/react-native.config.js +0 -61
- package/example/src/App.tsx +0 -187
- package/example/yarn.lock +0 -6542
- package/lib/typescript/example/index.d.ts +0 -1
- package/lib/typescript/example/src/App.d.ts +0 -2
- package/lib/typescript/src/__tests__/index.test.d.ts +0 -0
- package/src/__tests__/index.test.tsx +0 -1
- package/tsconfig.json +0 -27
- package/yarn.lock +0 -9701
package/example/src/App.tsx
DELETED
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Platform, StyleSheet, Text, View } from 'react-native';
|
|
3
|
-
import { MenuView } from '@react-native-menu/menu';
|
|
4
|
-
|
|
5
|
-
export const App = () => {
|
|
6
|
-
return (
|
|
7
|
-
<View style={styles.container}>
|
|
8
|
-
<MenuView
|
|
9
|
-
title="Menu Title"
|
|
10
|
-
onPressAction={({ nativeEvent }) => {
|
|
11
|
-
console.warn(JSON.stringify(nativeEvent));
|
|
12
|
-
}}
|
|
13
|
-
actions={[
|
|
14
|
-
{
|
|
15
|
-
id: 'add',
|
|
16
|
-
title: 'Add to List',
|
|
17
|
-
titleColor: '#2367A2',
|
|
18
|
-
image: Platform.select({
|
|
19
|
-
ios: 'plus',
|
|
20
|
-
android: 'ic_menu_add',
|
|
21
|
-
}),
|
|
22
|
-
imageColor: '#2367A2',
|
|
23
|
-
subactions: [
|
|
24
|
-
{
|
|
25
|
-
id: 'nested1',
|
|
26
|
-
title: 'Nested action',
|
|
27
|
-
titleColor: 'rgba(250,180,100,0.5)',
|
|
28
|
-
subtitle: 'State is mixed',
|
|
29
|
-
image: Platform.select({
|
|
30
|
-
ios: 'heart.fill',
|
|
31
|
-
android: 'ic_menu_today',
|
|
32
|
-
}),
|
|
33
|
-
imageColor: 'rgba(100,200,250,0.3)',
|
|
34
|
-
state: 'mixed',
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
id: 'nestedDestructive',
|
|
38
|
-
title: 'Destructive Action',
|
|
39
|
-
attributes: {
|
|
40
|
-
destructive: true,
|
|
41
|
-
},
|
|
42
|
-
image: Platform.select({
|
|
43
|
-
ios: 'trash',
|
|
44
|
-
android: 'ic_menu_delete',
|
|
45
|
-
}),
|
|
46
|
-
},
|
|
47
|
-
],
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
id: 'share',
|
|
51
|
-
title: 'Share Action',
|
|
52
|
-
titleColor: '#46F289',
|
|
53
|
-
subtitle: 'Share action on SNS',
|
|
54
|
-
image: Platform.select({
|
|
55
|
-
ios: 'square.and.arrow.up',
|
|
56
|
-
android: 'ic_menu_share',
|
|
57
|
-
}),
|
|
58
|
-
imageColor: '#46F289',
|
|
59
|
-
state: 'on',
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
id: 'mixed',
|
|
63
|
-
title: 'Mixed State',
|
|
64
|
-
titleColor: 'rgba(100,200,250,0.3)',
|
|
65
|
-
subtitle: 'State is mixed',
|
|
66
|
-
image: Platform.select({
|
|
67
|
-
ios: 'heart.fill',
|
|
68
|
-
android: 'ic_menu_today',
|
|
69
|
-
}),
|
|
70
|
-
imageColor: 'rgba(100,200,250,0.3)',
|
|
71
|
-
state: 'mixed',
|
|
72
|
-
subactions: [
|
|
73
|
-
{
|
|
74
|
-
id: 'nested2',
|
|
75
|
-
title: 'Nested action',
|
|
76
|
-
titleColor: 'rgba(250,180,100,0.5)',
|
|
77
|
-
subtitle: 'State is mixed',
|
|
78
|
-
image: Platform.select({
|
|
79
|
-
ios: 'tray',
|
|
80
|
-
android: 'ic_menu_agenda',
|
|
81
|
-
}),
|
|
82
|
-
imageColor: 'rgba(100,200,250,0.3)',
|
|
83
|
-
state: 'mixed',
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
id: 'nestedMixed',
|
|
87
|
-
title: 'Mixed State',
|
|
88
|
-
subtitle: 'State is mixed',
|
|
89
|
-
image: Platform.select({
|
|
90
|
-
ios: 'heart.fill',
|
|
91
|
-
android: 'ic_menu_today',
|
|
92
|
-
}),
|
|
93
|
-
imageColor: '#46F289',
|
|
94
|
-
subactions: [
|
|
95
|
-
{
|
|
96
|
-
id: 'nestednesteddisabled',
|
|
97
|
-
title: 'Disabled Action',
|
|
98
|
-
subtitle: 'Action is disabled',
|
|
99
|
-
attributes: {
|
|
100
|
-
disabled: true,
|
|
101
|
-
},
|
|
102
|
-
image: Platform.select({
|
|
103
|
-
ios: 'tray',
|
|
104
|
-
android: 'ic_menu_agenda',
|
|
105
|
-
}),
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
id: 'nestednestedhidden',
|
|
109
|
-
title: 'Hidden Action',
|
|
110
|
-
subtitle: 'Action is hidden',
|
|
111
|
-
attributes: {
|
|
112
|
-
hidden: true,
|
|
113
|
-
},
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
id: 'nestednesteddestructive',
|
|
117
|
-
title: 'Destructive Action',
|
|
118
|
-
attributes: {
|
|
119
|
-
destructive: true,
|
|
120
|
-
},
|
|
121
|
-
image: Platform.select({
|
|
122
|
-
ios: 'trash',
|
|
123
|
-
android: 'ic_menu_delete',
|
|
124
|
-
}),
|
|
125
|
-
},
|
|
126
|
-
],
|
|
127
|
-
},
|
|
128
|
-
],
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
id: 'disabled',
|
|
132
|
-
title: 'Disabled Action',
|
|
133
|
-
subtitle: 'Action is disabled',
|
|
134
|
-
attributes: {
|
|
135
|
-
disabled: true,
|
|
136
|
-
},
|
|
137
|
-
image: Platform.select({
|
|
138
|
-
ios: 'tray',
|
|
139
|
-
android: 'ic_menu_agenda',
|
|
140
|
-
}),
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
id: 'hidden',
|
|
144
|
-
title: 'Hidden Action',
|
|
145
|
-
subtitle: 'Action is hidden',
|
|
146
|
-
attributes: {
|
|
147
|
-
hidden: true,
|
|
148
|
-
},
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
id: 'destructive',
|
|
152
|
-
title: 'Destructive Action',
|
|
153
|
-
attributes: {
|
|
154
|
-
destructive: true,
|
|
155
|
-
},
|
|
156
|
-
image: Platform.select({
|
|
157
|
-
ios: 'trash',
|
|
158
|
-
android: 'ic_menu_delete',
|
|
159
|
-
}),
|
|
160
|
-
},
|
|
161
|
-
]}
|
|
162
|
-
shouldOpenOnLongPress={true}
|
|
163
|
-
>
|
|
164
|
-
<View style={styles.button}>
|
|
165
|
-
<Text style={styles.buttonText}>Test</Text>
|
|
166
|
-
</View>
|
|
167
|
-
</MenuView>
|
|
168
|
-
</View>
|
|
169
|
-
);
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
const styles = StyleSheet.create({
|
|
173
|
-
container: {
|
|
174
|
-
flex: 1,
|
|
175
|
-
alignItems: 'center',
|
|
176
|
-
justifyContent: 'center',
|
|
177
|
-
},
|
|
178
|
-
button: {
|
|
179
|
-
height: 100,
|
|
180
|
-
width: 100,
|
|
181
|
-
backgroundColor: 'red',
|
|
182
|
-
borderRadius: 50,
|
|
183
|
-
justifyContent: 'center',
|
|
184
|
-
alignItems: 'center',
|
|
185
|
-
},
|
|
186
|
-
buttonText: { color: 'white' },
|
|
187
|
-
});
|