-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathApp.tsx
More file actions
58 lines (54 loc) · 1.6 KB
/
Copy pathApp.tsx
File metadata and controls
58 lines (54 loc) · 1.6 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
import React from 'react';
import { FaChevronRight, FaChevronLeft } from 'react-icons/fa';
import Link from './LinkComponent';
import Content from './Content';
import { PushMenu } from './reactComponentLib';
function App() {
const data = {
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: [] },
],
},
};
return (
<PushMenu
backIcon={<FaChevronLeft />}
openOnMount
expanderComponent={FaChevronRight}
onNodeClick={(e: Event, context: { node: Record<string, any>; closeMenu: Function }) => {
e.preventDefault();
console.log(context);
context.closeMenu();
}}
linkComponent={Link}
nodes={data.menu}
propMap={{ url: 'link' }}
>
<Content />
</PushMenu>
);
}
export default App;