File tree Expand file tree Collapse file tree 3 files changed +36
-2
lines changed Expand file tree Collapse file tree 3 files changed +36
-2
lines changed Original file line number Diff line number Diff line change 1+ import { Component } from 'react' ;
2+ import { NativeSyntheticEvent } from 'react-native' ;
3+
4+ export interface ContextMenuAction {
5+ /**
6+ * The title of the action
7+ */
8+ title ?: string ;
9+ /**
10+ * The icon to use on ios. This is the name of the SFSymbols icon to use. On Android nothing will happen if you set this option.
11+ */
12+ systemIcon ?: string ;
13+ }
14+
15+ export interface ContextMenu extends Component {
16+ /**
17+ * The title of the menu
18+ */
19+ title ?: string ;
20+ /**
21+ * The actions to show the user when the menu is activated
22+ */
23+ actions ?: Array < ContextMenuAction > ;
24+ /**
25+ * Handle when an action is triggered and the menu is closed. The name of the selected action will be passed in the event.
26+ */
27+ onPress ?: ( e : NativeSyntheticEvent < { name : string } > ) => void ;
28+ /**
29+ * Handle when the menu is cancelled and closed
30+ */
31+ onCancel ?: ( ) => void ;
32+ }
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ - (UIView *) view {
1111
1212RCT_EXPORT_VIEW_PROPERTY (title, NSString )
1313RCT_EXPORT_VIEW_PROPERTY(onPress, RCTBubblingEventBlock)
14+ RCT_EXPORT_VIEW_PROPERTY(onCancel, RCTBubblingEventBlock)
1415RCT_EXPORT_VIEW_PROPERTY(actions, NSArray <ContextMenuAction>)
1516
1617@end
Original file line number Diff line number Diff line change 11{
22 "name" : " react-native-context-menu-view" ,
33 "title" : " React Native Context Menu View" ,
4- "version" : " 1.0.1 " ,
5- "description" : " TODO " ,
4+ "version" : " 1.0.2 " ,
5+ "description" : " Use native context menu views from React Native " ,
66 "main" : " index.js" ,
7+ "types" : " index.d.ts" ,
78 "scripts" : {
89 "test" : " echo \" Error: no test specified\" && exit 1"
910 },
You can’t perform that action at this time.
0 commit comments