forked from lwhiteley/react-push-menu
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
76 lines (69 loc) · 1.95 KB
/
Copy pathindex.js
File metadata and controls
76 lines (69 loc) · 1.95 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
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
import '../styles/normalize.css';
import '../styles/component.css';
import './demo.css';
// import '../styles/icons.css';
import React from 'react'
import {render} from 'react-dom';
import PushMenu from '../src/index'
import {FaBars, FaChevronRight, FaChevronLeft} from 'react-icons/fa';
import Link from './LinkComponent';
class Page extends React.Component{
constructor(props){
super(props);
this.state = {
menu: {
header: 'All Categories',
children: [
{
name: 'About',
id: 1,
link: '/about',
children: [
{name: 'Mission', id: 11, link: null, children: []},
{name: 'Objectives', id: 12, link: null, children: []},
{
name: 'Goals',
id: 13,
link:
'/about/goals',
children: [
{name: 'Charity', id: 131, link: null, children: []},
{name: 'Clean Environment Plan', id: 132, link: null, children: []},
]
}
]
},
{name: 'Services', id: 2, link: '/services', children: []},
{name: 'People', id: 3, link: '/people', children: []},
{name: 'Careers', id: 4, link: '/careers', children: []},
{name: 'Contact', id: 5, link: null, children: []},
]
}
}
}
render(){
return (
<PushMenu
backIcon={<FaChevronLeft />}
expanderComponent={FaChevronRight}
onNodeClick={(e, {menu, node}) => {
console.log(node)
menu.tools.reset();
}}
linkComponent={Link}
isOpen={false}
nodes={this.state.menu}
type={'cover'}
propMap={{url: 'link'}}>
<div className="rpm-trigger" id="rpm-trigger" >
<FaBars />
</div>
</PushMenu>
);
}
}
let rootElement = document.getElementById('root');
render(
<Page />,
rootElement
);