Skip to content

Commit a30a07d

Browse files
committed
📝 Updated README: Documentation WIP
1 parent 7f38481 commit a30a07d

File tree

1 file changed

+37
-1
lines changed

1 file changed

+37
-1
lines changed

README.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,8 @@ Enum string values you can use for the [`MenuConfig.imageType`](#332-menuconf
227227
| Value | Description |
228228
|--------|--------------------------------------------------------------|
229229
| NONE | The default value for the `imageType` property. Specifies to not use an icon. Since this is the default value, you don't have to explicitly specify: `imageType: 'NONE'` in the `MenuConfig` or `MenuAction` object if you don't want to use an icon. |
230-
| SYSTEM | Specifies that we want to a system image (i.e. like a [SF Symbols](https://developer.apple.com/design/human-interface-guidelines/sf-symbols/overview/) icon). Internally, it passes the `imageValue` string from the `MenuConfig` or `MenuAction` object like this: `UIImage(systemName: imageValue)` |
230+
| SYSTEM | Specifies that we want to a system image (i.e. like a [SF Symbols](https://developer.apple.com/design/human-interface-guidelines/sf-symbols/overview/) icon). The `imageValue` string from a `MenuConfig` or `MenuAction` object will be used to create an `UIImage` instance: `UIImage(systemName: imageValue)`. So the `imageValue` string must correspond to an SF Symbols icon. |
231+
| ASSET | Specifies that we want to use an image in the Xcode project's asset catalog. The `imageValue` string from a `MenuConfig` or `MenuAction` object will be used to create an `UIImage` instance: `UIImage(named: imageValue)`. So the `imageValue` string must correspond to an asset/item in the `xcasset` catalog. |
231232
<br>
232233

233234
#### 3.2.2 `MenuOptions` Enum
@@ -1169,6 +1170,41 @@ class ContextMenuViewSimpleExample15 extends React.PureComponent {
11691170

11701171
<br><br>
11711172

1173+
4.1.15 `ContextMenuView` [Simple Example #15](https://github.com/dominicstop/react-native-ios-context-menu/blob/master/example/src/components/ContextMenuView/ContextMenuViewSimpleExample14.js)
1174+
A example context menu configured to have 3 menu actions. The first action has no icon, the second uses a `SYSTEM` SF Symbols icon, and the third uses a `ASSET` icon.
1175+
* If you are using an `ASSET` icon, the the string that you pass to the `imageValue` property must correspond to an image asset in your Xcode project's `xcasset` catalog.
1176+
<br>
1177+
1178+
```jsx
1179+
<ContextMenuView
1180+
menuConfig={{
1181+
menuTitle: 'ContextMenuViewSimpleExample16',
1182+
menuItems: [{
1183+
actionKey : 'key-01',
1184+
actionTitle: 'Action #1',
1185+
discoverabilityTitle: 'No Icon'
1186+
}, {
1187+
actionKey : 'key-02' ,
1188+
actionTitle: 'Action #2',
1189+
imageType : 'SYSTEM',
1190+
imageValue : 'dial.fill',
1191+
discoverabilityTitle: 'Use "SYSTEM" icon'
1192+
1193+
}, {
1194+
actionKey : 'key-03' ,
1195+
actionTitle: 'Action #3',
1196+
imageType : 'ASSET' ,
1197+
imageValue : 'icon-rainbow-flag',
1198+
discoverabilityTitle: 'Use "ASSET" icon'
1199+
}],
1200+
}}
1201+
/>
1202+
```
1203+
1204+
![Simple Example 16](./assets/example-screenshots/ContextMenuView-SimpleExample16.png)
1205+
1206+
<br><br>
1207+
11721208
### 4.2 `ContextMenuButton` Examples
11731209
Most of the examples in the `ContextMenuView` section also applies here. The props in `ContextMenuView` (like the `menuConfig` and `useActionSheetFallback` props) as well as most of the events behave the same.
11741210

0 commit comments

Comments
 (0)