forked from vkbansal/react-contextmenu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
88 lines (82 loc) · 3.21 KB
/
index.js
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
import React from 'react';
import ReactDOM from 'react-dom';
import { HashRouter as Router, Route, NavLink as Link, Switch } from 'react-router-dom';
import SimpleMenu from './SimpleMenu';
import MultipleTargets from './MultipleTargets';
import MultipleMenus from './MultipleMenus';
import SubMenus from './SubMenus';
import DynamicMenu from './DynamicMenu';
import Customization from './Customization';
import RTLSubMenu from './RTLSubMenu';
import Nested from './Nested';
import './react-contextmenu.css';
const commonProps = {
className: 'pure-menu-link',
activeClassName: 'link-active'
};
function App() {
return (
<div>
<div className='pure-menu pure-menu-horizontal'>
<ul className='pure-menu-list'>
<li className='pure-menu-item'>
<Link {...commonProps} to='/simple-menu'>
Simple Menu
</Link>
</li>
<li className='pure-menu-item'>
<Link {...commonProps} to='/multiple-targets'>
Multiple Targets
</Link>
</li>
<li className='pure-menu-item'>
<Link {...commonProps} to='/multiple-menus'>
Multiple Menus
</Link>
</li>
<li className='pure-menu-item'>
<Link {...commonProps} to='/submenus'>
Sub Menus
</Link>
</li>
<li className='pure-menu-item'>
<Link {...commonProps} to='/dynamic-menu'>
Dynamic Menu
</Link>
</li>
<li className='pure-menu-item'>
<Link {...commonProps} to='/customization'>
Customization
</Link>
</li>
<li className='pure-menu-item'>
<Link {...commonProps} to='/rtl-submenus'>
Right-to-Left
</Link>
</li>
<li className='pure-menu-item'>
<Link {...commonProps} to='/nested'>
Nested
</Link>
</li>
</ul>
</div>
<Switch>
<Route path='/simple-menu' component={SimpleMenu} />
<Route path='/multiple-targets' component={MultipleTargets} />
<Route path='/multiple-menus' component={MultipleMenus} />
<Route path='/submenus' component={SubMenus} />
<Route path='/dynamic-menu' component={DynamicMenu} />
<Route path='/customization' component={Customization} />
<Route path='/rtl-submenus' component={RTLSubMenu} />
<Route path='/nested' component={Nested} />
</Switch>
</div>
);
}
const Routes = (
<Router>
<App />
</Router>
);
ReactDOM.render(Routes, document.getElementById('main'));