refined docu

This commit is contained in:
Martin Bielik 2016-05-30 09:17:00 +02:00
parent 302d73694a
commit 649f4c6ea1
4 changed files with 15 additions and 3 deletions

View File

@ -36,6 +36,9 @@ export const App = () => (
<MenuOptions>
<MenuOption value={1} text='One' />
<MenuOption value={2} text='Two' />
<MenuOption value={3} disabled={true}>
<Text style={{color: '#ccc'}}>Three</Text>
</MenuOption>
</MenuOptions>
</Menu>
</MenuContext>
@ -72,6 +75,9 @@ export default class ControlledExample extends Component {
<MenuOptions>
<MenuOption value={1} text='One' />
<MenuOption value={2} text='Two' />
<MenuOption value={3} disabled={true}>
<Text style={{color: '#ccc'}}>Three</Text>
</MenuOption>
</MenuOptions>
</Menu>
</MenuContext>

View File

@ -27,7 +27,7 @@ Root menu component defining menu name and providing menu events.
|`opened`|`Boolean`|Optional||Declaratively states if menu is opened. When this prop is provided, menu is controlled and imperative API won't work.|
### Events
| Event Name | Returns | Notes |
| Event Name | Arguments | Notes |
|---|---|---|
|`onSelect`|`optionValue`|Triggered when menu option is selected. When event handler returns `false`, the popup menu remains open|
|`onOpen`||Triggered when menu is opened|
@ -51,7 +51,7 @@ Menu can by opened by clicking on `<MenuTrigger />` or by calling context method
|`text`|`String`|Optional||Text to be rendered. When this prop is provided, trigger's children won't be rendered|
### Events
| Event Name | Returns | Notes |
| Event Name | Arguments | Notes |
|---|---|---|
|`onPress`||Triggered when trigger is pressed|
@ -81,7 +81,7 @@ Wrapper component of menu option.
|`disabled`|`Boolean`|Optional|`false`|Indicates if option can be pressed|
### Events
| Event Name | Returns | Notes |
| Event Name | Arguments | Notes |
|---|---|---|
|`onSelect`||Triggered when option is selected. When event handler returns `false`, the popup menu remains open. Note: If this event handler is defined, it suppress `onSelect` handler of `<Menu />`|

View File

@ -15,6 +15,9 @@ const BasicExample = () => (
<MenuOptions>
<MenuOption value={1} text='One' />
<MenuOption value={2} text='Two' />
<MenuOption value={3} disabled={true}>
<Text style={{color: '#ccc'}}>Three</Text>
</MenuOption>
</MenuOptions>
</Menu>
</MenuContext>

View File

@ -42,6 +42,9 @@ export default class ControlledExample extends Component {
<MenuOptions>
<MenuOption value={1} text='One' />
<MenuOption value={2} text='Two' />
<MenuOption value={3} disabled={true}>
<Text style={{color: '#ccc'}}>Three</Text>
</MenuOption>
</MenuOptions>
</Menu>
</MenuContext>