@react-native-menu/menu 0.8.0 → 0.9.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/.settings/org.eclipse.buildship.core.prefs +1 -1
- package/ios/MenuView.swift +11 -1
- package/ios/RCTUIMenuManager.m +4 -0
- package/lib/commonjs/UIMenuView.js.map +1 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/module/UIMenuView.js.map +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/typescript/src/UIMenuView.d.ts +1 -1
- package/lib/typescript/src/types.d.ts +8 -0
- package/package.json +11 -11
- package/src/UIMenuView.tsx +4 -1
- package/src/types.ts +8 -0
package/ios/MenuView.swift
CHANGED
|
@@ -42,6 +42,12 @@ class MenuView: UIButton {
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
@objc var darkMode: Bool = false {
|
|
46
|
+
didSet {
|
|
47
|
+
self.setup()
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
45
51
|
override init(frame: CGRect) {
|
|
46
52
|
super.init(frame: frame)
|
|
47
53
|
self.setup()
|
|
@@ -50,7 +56,11 @@ class MenuView: UIButton {
|
|
|
50
56
|
|
|
51
57
|
func setup () {
|
|
52
58
|
let menu = UIMenu(title:_title, identifier: nil, children: self._actions)
|
|
53
|
-
|
|
59
|
+
if self.darkMode {
|
|
60
|
+
self.overrideUserInterfaceStyle = .dark
|
|
61
|
+
} else {
|
|
62
|
+
self.overrideUserInterfaceStyle = .light
|
|
63
|
+
}
|
|
54
64
|
self.menu = menu
|
|
55
65
|
self.showsMenuAsPrimaryAction = !shouldOpenOnLongPress
|
|
56
66
|
}
|
package/ios/RCTUIMenuManager.m
CHANGED
|
@@ -19,5 +19,9 @@ RCT_EXPORT_VIEW_PROPERTY(onPressAction, RCTDirectEventBlock);
|
|
|
19
19
|
* shouldOpenOnLongPress: determines whether menu should be opened after long press or normal press
|
|
20
20
|
*/
|
|
21
21
|
RCT_EXPORT_VIEW_PROPERTY(shouldOpenOnLongPress, BOOL)
|
|
22
|
+
/**
|
|
23
|
+
* darkMode: determines whether menu should be dark mode or light mode
|
|
24
|
+
*/
|
|
25
|
+
RCT_EXPORT_VIEW_PROPERTY(darkMode, BOOL)
|
|
22
26
|
|
|
23
27
|
@end
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["MenuView","style","children"],"sources":["UIMenuView.tsx"],"sourcesContent":["import * as React from 'react';\nimport { View } from 'react-native';\nimport type { NativeMenuComponentProps } from './types';\n\n/**\n * TODO: implement for Web\n */\nconst MenuView: React.FC<NativeMenuComponentProps
|
|
1
|
+
{"version":3,"names":["MenuView","style","children"],"sources":["UIMenuView.tsx"],"sourcesContent":["import * as React from 'react';\nimport { View } from 'react-native';\nimport type { NativeMenuComponentProps } from './types';\n\n/**\n * TODO: implement for Web\n */\nconst MenuView: React.FC<React.PropsWithChildren<NativeMenuComponentProps>> = ({\n style,\n children,\n}) => {\n return <View style={style}>{children}</View>;\n};\n\nexport default MenuView;\n"],"mappings":";;;;;;;AAAA;;AACA;;;;;;AAGA;AACA;AACA;AACA,MAAMA,QAAqE,GAAG,CAAC;EAC7EC,KAD6E;EAE7EC;AAF6E,CAAD,KAGxE;EACJ,oBAAO,oBAAC,iBAAD;IAAM,KAAK,EAAED;EAAb,GAAqBC,QAArB,CAAP;AACD,CALD;;eAOeF,Q"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {\n ColorValue,\n processColor,\n StyleProp,\n ViewStyle,\n} from 'react-native';\nimport type * as React from 'react';\n\nexport type NativeActionEvent = {\n nativeEvent: {\n event: string;\n };\n};\n\ntype MenuAttributes = {\n /**\n * An attribute indicating the destructive style.\n */\n destructive?: boolean;\n /**\n * An attribute indicating the disabled style.\n */\n disabled?: boolean;\n /**\n * An attribute indicating the hidden style.\n */\n hidden?: boolean;\n};\n\n/**\n * The state of the action.\n * - off: A constant indicating the menu element is in the “off” state.\n * - on: A constant indicating the menu element is in the “on” state.\n * - mixed: A constant indicating the menu element is in the “mixed” state.\n */\ntype MenuState = 'off' | 'on' | 'mixed';\n\nexport type MenuAction = {\n /**\n * Identifier of the menu action.\n * The value set in this id will be returned when menu is selected.\n */\n id?: string;\n /**\n * The action's title.\n */\n title: string;\n /**\n * (Android only)\n * The action's title color.\n * @platform Android\n */\n titleColor?: number | ColorValue;\n /**\n * (iOS14+ only)\n * An elaborated title that explains the purpose of the action.\n * @platform iOS\n */\n subtitle?: string;\n /**\n * The attributes indicating the style of the action.\n */\n attributes?: MenuAttributes;\n /**\n * (iOS14+ only)\n * The state of the action.\n * @platform iOS\n */\n state?: MenuState;\n /**\n * (Android and iOS13+ only)\n * - The action's image.\n * - Allows icon name included in project or system (Android) resources drawables and\n * in SF Symbol (iOS)\n * @example // (iOS)\n * image=\"plus\"\n * @example // (Android)\n * image=\"ic_menu_add\"\n * - TODO: Allow images other than those included in SF Symbol and resources drawables\n */\n image?: string;\n /**\n * (Android and iOS13+ only)\n * - The action's image color.\n */\n imageColor?: number | ColorValue;\n /**\n * (Android and iOS14+ only)\n * - Actions to be displayed in the sub menu\n * - On Android it does not support nesting next sub menus in sub menu item\n */\n subactions?: MenuAction[];\n /**\n * Whether subactions should be inline (separated by divider) or nested (sub menu)\n */\n displayInline?: boolean;\n};\n\ntype MenuComponentPropsBase = {\n style?: StyleProp<ViewStyle>;\n /**\n * Callback function that will be called when selecting a menu item.\n * It will contain id of the given action.\n */\n onPressAction?: ({ nativeEvent }: NativeActionEvent) => void;\n /**\n * Actions to be displayed in the menu.\n */\n actions: MenuAction[];\n /**\n * The title of the menu.\n */\n title?: string;\n /**\n * (Android API 23+)\n * Boolean value determines whether popup menu should be anchored\n * to right corner of parent view - default value is `false`\n * @platform Android\n */\n isAnchoredToRight?: boolean;\n /**\n * Determines if menu should open after long press or on normal press\n *\n * @default false\n */\n shouldOpenOnLongPress?: boolean;\n};\n\nexport type MenuComponentProps =\n React.PropsWithChildren<MenuComponentPropsBase>;\n\nexport type ProcessedMenuAction = Omit<\n MenuAction,\n 'imageColor' | 'titleColor' | 'subactions'\n> & {\n imageColor: ReturnType<typeof processColor>;\n titleColor: ReturnType<typeof processColor>;\n subactions?: ProcessedMenuAction[];\n};\n\nexport type NativeMenuComponentProps = {\n style?: StyleProp<ViewStyle>;\n onPressAction?: ({ nativeEvent }: NativeActionEvent) => void;\n actions: ProcessedMenuAction[];\n title?: string;\n};\n"],"mappings":""}
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {\n ColorValue,\n processColor,\n StyleProp,\n ViewStyle,\n} from 'react-native';\nimport type * as React from 'react';\n\nexport type NativeActionEvent = {\n nativeEvent: {\n event: string;\n };\n};\n\ntype MenuAttributes = {\n /**\n * An attribute indicating the destructive style.\n */\n destructive?: boolean;\n /**\n * An attribute indicating the disabled style.\n */\n disabled?: boolean;\n /**\n * An attribute indicating the hidden style.\n */\n hidden?: boolean;\n};\n\n/**\n * The state of the action.\n * - off: A constant indicating the menu element is in the “off” state.\n * - on: A constant indicating the menu element is in the “on” state.\n * - mixed: A constant indicating the menu element is in the “mixed” state.\n */\ntype MenuState = 'off' | 'on' | 'mixed';\n\nexport type MenuAction = {\n /**\n * Identifier of the menu action.\n * The value set in this id will be returned when menu is selected.\n */\n id?: string;\n /**\n * The action's title.\n */\n title: string;\n /**\n * (Android only)\n * The action's title color.\n * @platform Android\n */\n titleColor?: number | ColorValue;\n /**\n * (iOS14+ only)\n * An elaborated title that explains the purpose of the action.\n * @platform iOS\n */\n subtitle?: string;\n /**\n * The attributes indicating the style of the action.\n */\n attributes?: MenuAttributes;\n /**\n * (iOS14+ only)\n * The state of the action.\n * @platform iOS\n */\n state?: MenuState;\n /**\n * (Android and iOS13+ only)\n * - The action's image.\n * - Allows icon name included in project or system (Android) resources drawables and\n * in SF Symbol (iOS)\n * @example // (iOS)\n * image=\"plus\"\n * @example // (Android)\n * image=\"ic_menu_add\"\n * - TODO: Allow images other than those included in SF Symbol and resources drawables\n */\n image?: string;\n /**\n * (Android and iOS13+ only)\n * - The action's image color.\n */\n imageColor?: number | ColorValue;\n /**\n * (Android and iOS14+ only)\n * - Actions to be displayed in the sub menu\n * - On Android it does not support nesting next sub menus in sub menu item\n */\n subactions?: MenuAction[];\n /**\n * Whether subactions should be inline (separated by divider) or nested (sub menu)\n */\n displayInline?: boolean;\n};\n\ntype MenuComponentPropsBase = {\n style?: StyleProp<ViewStyle>;\n /**\n * Callback function that will be called when selecting a menu item.\n * It will contain id of the given action.\n */\n onPressAction?: ({ nativeEvent }: NativeActionEvent) => void;\n /**\n * Actions to be displayed in the menu.\n */\n actions: MenuAction[];\n /**\n * The title of the menu.\n */\n title?: string;\n /**\n * (Android API 23+)\n * Boolean value determines whether popup menu should be anchored\n * to right corner of parent view - default value is `false`\n * @platform Android\n */\n isAnchoredToRight?: boolean;\n /**\n * Determines if menu should open after long press or on normal press\n *\n * @default false\n */\n shouldOpenOnLongPress?: boolean;\n /**\n * Determines if menu should be displayed in dark mode or light mode\n * (Only support iOS for now)\n *\n * @default false\n * @platform iOS\n */\n darkMode?: boolean;\n};\n\nexport type MenuComponentProps =\n React.PropsWithChildren<MenuComponentPropsBase>;\n\nexport type ProcessedMenuAction = Omit<\n MenuAction,\n 'imageColor' | 'titleColor' | 'subactions'\n> & {\n imageColor: ReturnType<typeof processColor>;\n titleColor: ReturnType<typeof processColor>;\n subactions?: ProcessedMenuAction[];\n};\n\nexport type NativeMenuComponentProps = {\n style?: StyleProp<ViewStyle>;\n onPressAction?: ({ nativeEvent }: NativeActionEvent) => void;\n actions: ProcessedMenuAction[];\n title?: string;\n};\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","MenuView","style","children"],"sources":["UIMenuView.tsx"],"sourcesContent":["import * as React from 'react';\nimport { View } from 'react-native';\nimport type { NativeMenuComponentProps } from './types';\n\n/**\n * TODO: implement for Web\n */\nconst MenuView: React.FC<NativeMenuComponentProps
|
|
1
|
+
{"version":3,"names":["React","View","MenuView","style","children"],"sources":["UIMenuView.tsx"],"sourcesContent":["import * as React from 'react';\nimport { View } from 'react-native';\nimport type { NativeMenuComponentProps } from './types';\n\n/**\n * TODO: implement for Web\n */\nconst MenuView: React.FC<React.PropsWithChildren<NativeMenuComponentProps>> = ({\n style,\n children,\n}) => {\n return <View style={style}>{children}</View>;\n};\n\nexport default MenuView;\n"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,IAAT,QAAqB,cAArB;;AAGA;AACA;AACA;AACA,MAAMC,QAAqE,GAAG,CAAC;EAC7EC,KAD6E;EAE7EC;AAF6E,CAAD,KAGxE;EACJ,oBAAO,oBAAC,IAAD;IAAM,KAAK,EAAED;EAAb,GAAqBC,QAArB,CAAP;AACD,CALD;;AAOA,eAAeF,QAAf"}
|
package/lib/module/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {\n ColorValue,\n processColor,\n StyleProp,\n ViewStyle,\n} from 'react-native';\nimport type * as React from 'react';\n\nexport type NativeActionEvent = {\n nativeEvent: {\n event: string;\n };\n};\n\ntype MenuAttributes = {\n /**\n * An attribute indicating the destructive style.\n */\n destructive?: boolean;\n /**\n * An attribute indicating the disabled style.\n */\n disabled?: boolean;\n /**\n * An attribute indicating the hidden style.\n */\n hidden?: boolean;\n};\n\n/**\n * The state of the action.\n * - off: A constant indicating the menu element is in the “off” state.\n * - on: A constant indicating the menu element is in the “on” state.\n * - mixed: A constant indicating the menu element is in the “mixed” state.\n */\ntype MenuState = 'off' | 'on' | 'mixed';\n\nexport type MenuAction = {\n /**\n * Identifier of the menu action.\n * The value set in this id will be returned when menu is selected.\n */\n id?: string;\n /**\n * The action's title.\n */\n title: string;\n /**\n * (Android only)\n * The action's title color.\n * @platform Android\n */\n titleColor?: number | ColorValue;\n /**\n * (iOS14+ only)\n * An elaborated title that explains the purpose of the action.\n * @platform iOS\n */\n subtitle?: string;\n /**\n * The attributes indicating the style of the action.\n */\n attributes?: MenuAttributes;\n /**\n * (iOS14+ only)\n * The state of the action.\n * @platform iOS\n */\n state?: MenuState;\n /**\n * (Android and iOS13+ only)\n * - The action's image.\n * - Allows icon name included in project or system (Android) resources drawables and\n * in SF Symbol (iOS)\n * @example // (iOS)\n * image=\"plus\"\n * @example // (Android)\n * image=\"ic_menu_add\"\n * - TODO: Allow images other than those included in SF Symbol and resources drawables\n */\n image?: string;\n /**\n * (Android and iOS13+ only)\n * - The action's image color.\n */\n imageColor?: number | ColorValue;\n /**\n * (Android and iOS14+ only)\n * - Actions to be displayed in the sub menu\n * - On Android it does not support nesting next sub menus in sub menu item\n */\n subactions?: MenuAction[];\n /**\n * Whether subactions should be inline (separated by divider) or nested (sub menu)\n */\n displayInline?: boolean;\n};\n\ntype MenuComponentPropsBase = {\n style?: StyleProp<ViewStyle>;\n /**\n * Callback function that will be called when selecting a menu item.\n * It will contain id of the given action.\n */\n onPressAction?: ({ nativeEvent }: NativeActionEvent) => void;\n /**\n * Actions to be displayed in the menu.\n */\n actions: MenuAction[];\n /**\n * The title of the menu.\n */\n title?: string;\n /**\n * (Android API 23+)\n * Boolean value determines whether popup menu should be anchored\n * to right corner of parent view - default value is `false`\n * @platform Android\n */\n isAnchoredToRight?: boolean;\n /**\n * Determines if menu should open after long press or on normal press\n *\n * @default false\n */\n shouldOpenOnLongPress?: boolean;\n};\n\nexport type MenuComponentProps =\n React.PropsWithChildren<MenuComponentPropsBase>;\n\nexport type ProcessedMenuAction = Omit<\n MenuAction,\n 'imageColor' | 'titleColor' | 'subactions'\n> & {\n imageColor: ReturnType<typeof processColor>;\n titleColor: ReturnType<typeof processColor>;\n subactions?: ProcessedMenuAction[];\n};\n\nexport type NativeMenuComponentProps = {\n style?: StyleProp<ViewStyle>;\n onPressAction?: ({ nativeEvent }: NativeActionEvent) => void;\n actions: ProcessedMenuAction[];\n title?: string;\n};\n"],"mappings":""}
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {\n ColorValue,\n processColor,\n StyleProp,\n ViewStyle,\n} from 'react-native';\nimport type * as React from 'react';\n\nexport type NativeActionEvent = {\n nativeEvent: {\n event: string;\n };\n};\n\ntype MenuAttributes = {\n /**\n * An attribute indicating the destructive style.\n */\n destructive?: boolean;\n /**\n * An attribute indicating the disabled style.\n */\n disabled?: boolean;\n /**\n * An attribute indicating the hidden style.\n */\n hidden?: boolean;\n};\n\n/**\n * The state of the action.\n * - off: A constant indicating the menu element is in the “off” state.\n * - on: A constant indicating the menu element is in the “on” state.\n * - mixed: A constant indicating the menu element is in the “mixed” state.\n */\ntype MenuState = 'off' | 'on' | 'mixed';\n\nexport type MenuAction = {\n /**\n * Identifier of the menu action.\n * The value set in this id will be returned when menu is selected.\n */\n id?: string;\n /**\n * The action's title.\n */\n title: string;\n /**\n * (Android only)\n * The action's title color.\n * @platform Android\n */\n titleColor?: number | ColorValue;\n /**\n * (iOS14+ only)\n * An elaborated title that explains the purpose of the action.\n * @platform iOS\n */\n subtitle?: string;\n /**\n * The attributes indicating the style of the action.\n */\n attributes?: MenuAttributes;\n /**\n * (iOS14+ only)\n * The state of the action.\n * @platform iOS\n */\n state?: MenuState;\n /**\n * (Android and iOS13+ only)\n * - The action's image.\n * - Allows icon name included in project or system (Android) resources drawables and\n * in SF Symbol (iOS)\n * @example // (iOS)\n * image=\"plus\"\n * @example // (Android)\n * image=\"ic_menu_add\"\n * - TODO: Allow images other than those included in SF Symbol and resources drawables\n */\n image?: string;\n /**\n * (Android and iOS13+ only)\n * - The action's image color.\n */\n imageColor?: number | ColorValue;\n /**\n * (Android and iOS14+ only)\n * - Actions to be displayed in the sub menu\n * - On Android it does not support nesting next sub menus in sub menu item\n */\n subactions?: MenuAction[];\n /**\n * Whether subactions should be inline (separated by divider) or nested (sub menu)\n */\n displayInline?: boolean;\n};\n\ntype MenuComponentPropsBase = {\n style?: StyleProp<ViewStyle>;\n /**\n * Callback function that will be called when selecting a menu item.\n * It will contain id of the given action.\n */\n onPressAction?: ({ nativeEvent }: NativeActionEvent) => void;\n /**\n * Actions to be displayed in the menu.\n */\n actions: MenuAction[];\n /**\n * The title of the menu.\n */\n title?: string;\n /**\n * (Android API 23+)\n * Boolean value determines whether popup menu should be anchored\n * to right corner of parent view - default value is `false`\n * @platform Android\n */\n isAnchoredToRight?: boolean;\n /**\n * Determines if menu should open after long press or on normal press\n *\n * @default false\n */\n shouldOpenOnLongPress?: boolean;\n /**\n * Determines if menu should be displayed in dark mode or light mode\n * (Only support iOS for now)\n *\n * @default false\n * @platform iOS\n */\n darkMode?: boolean;\n};\n\nexport type MenuComponentProps =\n React.PropsWithChildren<MenuComponentPropsBase>;\n\nexport type ProcessedMenuAction = Omit<\n MenuAction,\n 'imageColor' | 'titleColor' | 'subactions'\n> & {\n imageColor: ReturnType<typeof processColor>;\n titleColor: ReturnType<typeof processColor>;\n subactions?: ProcessedMenuAction[];\n};\n\nexport type NativeMenuComponentProps = {\n style?: StyleProp<ViewStyle>;\n onPressAction?: ({ nativeEvent }: NativeActionEvent) => void;\n actions: ProcessedMenuAction[];\n title?: string;\n};\n"],"mappings":""}
|
|
@@ -114,6 +114,14 @@ declare type MenuComponentPropsBase = {
|
|
|
114
114
|
* @default false
|
|
115
115
|
*/
|
|
116
116
|
shouldOpenOnLongPress?: boolean;
|
|
117
|
+
/**
|
|
118
|
+
* Determines if menu should be displayed in dark mode or light mode
|
|
119
|
+
* (Only support iOS for now)
|
|
120
|
+
*
|
|
121
|
+
* @default false
|
|
122
|
+
* @platform iOS
|
|
123
|
+
*/
|
|
124
|
+
darkMode?: boolean;
|
|
117
125
|
};
|
|
118
126
|
export declare type MenuComponentProps = React.PropsWithChildren<MenuComponentPropsBase>;
|
|
119
127
|
export declare type ProcessedMenuAction = Omit<MenuAction, 'imageColor' | 'titleColor' | 'subactions'> & {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-native-menu/menu",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "UIMenu component for react-native",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -43,22 +43,22 @@
|
|
|
43
43
|
"homepage": "https://github.com/react-native-menu/menu#readme",
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@react-native-community/bob": "^0.17.1",
|
|
46
|
-
"@react-native
|
|
46
|
+
"@react-native/eslint-config": "^0.72.2",
|
|
47
47
|
"@release-it/conventional-changelog": "^3.0.1",
|
|
48
48
|
"@types/jest": "^29.1.2",
|
|
49
|
-
"@types/react": "^
|
|
50
|
-
"@types/react-native": "0.
|
|
51
|
-
"eslint": "8.
|
|
52
|
-
"eslint-config-prettier": "^
|
|
49
|
+
"@types/react": "^18.2.2",
|
|
50
|
+
"@types/react-native": "0.72.2",
|
|
51
|
+
"eslint": "8.47.0",
|
|
52
|
+
"eslint-config-prettier": "^9.0.0",
|
|
53
53
|
"eslint-plugin-prettier": "^4.2.1",
|
|
54
54
|
"jest": "^29.1.2",
|
|
55
55
|
"pod-install": "^0.1.0",
|
|
56
56
|
"prettier": "^2.2.1",
|
|
57
|
-
"react": "
|
|
58
|
-
"react-native": "0.
|
|
59
|
-
"react-native-test-app": "^2.
|
|
57
|
+
"react": "18.2.0",
|
|
58
|
+
"react-native": "0.72.2",
|
|
59
|
+
"react-native-test-app": "^2.5.20",
|
|
60
60
|
"release-it": "^14.10.0",
|
|
61
|
-
"typescript": "
|
|
61
|
+
"typescript": "4.8.4"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
64
|
"react": "*",
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
},
|
|
91
91
|
"eslintConfig": {
|
|
92
92
|
"extends": [
|
|
93
|
-
"@react-native
|
|
93
|
+
"@react-native",
|
|
94
94
|
"prettier"
|
|
95
95
|
],
|
|
96
96
|
"rules": {
|
package/src/UIMenuView.tsx
CHANGED
|
@@ -5,7 +5,10 @@ import type { NativeMenuComponentProps } from './types';
|
|
|
5
5
|
/**
|
|
6
6
|
* TODO: implement for Web
|
|
7
7
|
*/
|
|
8
|
-
const MenuView: React.FC<NativeMenuComponentProps
|
|
8
|
+
const MenuView: React.FC<React.PropsWithChildren<NativeMenuComponentProps>> = ({
|
|
9
|
+
style,
|
|
10
|
+
children,
|
|
11
|
+
}) => {
|
|
9
12
|
return <View style={style}>{children}</View>;
|
|
10
13
|
};
|
|
11
14
|
|
package/src/types.ts
CHANGED
|
@@ -124,6 +124,14 @@ type MenuComponentPropsBase = {
|
|
|
124
124
|
* @default false
|
|
125
125
|
*/
|
|
126
126
|
shouldOpenOnLongPress?: boolean;
|
|
127
|
+
/**
|
|
128
|
+
* Determines if menu should be displayed in dark mode or light mode
|
|
129
|
+
* (Only support iOS for now)
|
|
130
|
+
*
|
|
131
|
+
* @default false
|
|
132
|
+
* @platform iOS
|
|
133
|
+
*/
|
|
134
|
+
darkMode?: boolean;
|
|
127
135
|
};
|
|
128
136
|
|
|
129
137
|
export type MenuComponentProps =
|