forked from yuristrelets/react-toolbox
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmenu.js
More file actions
38 lines (32 loc) · 1.17 KB
/
menu.js
File metadata and controls
38 lines (32 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import React from 'react';
import { Menu, MenuItem, MenuDivider } from '../../components/menu';
class MenuTest extends React.Component {
state = {
value: undefined
};
handleSelect = (item) => {
console.log('Menu selection changed!!, now its', item);
this.setState({value: item});
};
handleItemClick = () => {
console.log('This item is so special that has a special handler');
};
render () {
return (
<section>
<h5>Menus</h5>
<p>This tabs can be disabled or hidden</p>
<Menu onSelect={this.handleSelect} selectable={false} selected={this.state.value}>
<MenuItem value='foo' caption='Caption' />
<MenuItem onClick={this.handleItemClick} value='bar' caption='Caption & Shortcut' shortcut='Ctrl + P' />
<MenuItem caption='Disabled ...' disabled shortcut='Ctrl + P' />
<MenuDivider />
<MenuItem caption='Caption & Icon' icon='phone' />
<MenuItem caption='Caption, Icon & Shortcut' icon='phone' shortcut='Ctrl + P' />
<MenuItem caption='Disabled ...' icon='phone' shortcut='Ctrl + P' disabled/>
</Menu>
</section>
);
}
}
export default MenuTest;