MCPcopy Create free account
hub / github.com/flyfloor/react-component / MenuDemo

Class MenuDemo

demo/example/MenuDemo.jsx:4–175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2import {Menu, Item} from './index.js';
3
4export default class MenuDemo extends React.Component {
5 constructor(props){
6 super(props);
7 this.state = {
8 index: "1",
9 };
10 }
11 displayChange(index){
12 this.setState({
13 index: index
14 });
15 }
16
17 formatChild({current, accordion=false, onChange, style, popped=false, mode='click', horizontal=false, activeFirst=false}) {
18 return <Menu current={current} accordion={accordion} onChange={onChange} horizontal={horizontal} style={style} popped={popped} mode={mode}>
19 <Item index='sub0' sub={true} active={activeFirst} title={<p>Sub Menu</p>}>
20 <Menu className="second-menu">
21 <Item index="0">
22 <p>Sub item</p>
23 </Item>
24 <Item index="1">
25 <p>Sub item</p>
26 </Item>
27 <Item index="2" disabled={true}>
28 <p>Sub item</p>
29 </Item>
30 <Item sub={true} index="sub0_1" title={<p>Third Menu</p>}>
31 <Menu className="third-menu">
32 <Item index="10">
33 <p>Third item</p>
34 </Item>
35 <Item index="11">
36 <p>Third item</p>
37 </Item>
38 </Menu>
39 </Item>
40 </Menu>
41 </Item>
42 <Item index="sub1" sub={true} title={<p>Sub Menu</p>}>
43 <Menu className="second-menu">
44 <Item index="sub1_0" sub={true} title={<p>Third Menu</p>}>
45 <Menu className="third-menu">
46 <Item index="6" disabled={true}>
47 <p>Third item</p>
48 </Item>
49 <Item index="7">
50 <p>Third item</p>
51 </Item>
52 </Menu>
53 </Item>
54 <Item index="sub1_1" sub={true} title={<p>Third Menu</p>}>
55 <Menu className="third-menu">
56 <Item index="8">
57 <p>Third item</p>
58 </Item>
59 <Item index="9">
60 <p>Third item</p>
61 </Item>

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…