1
+ //@ts -ignore
2
+ import { DrawerLayout } from "fm-react-layout" ;
3
+ import { useRef } from "react" ;
4
+ import DrawerLayoutContent from "./drawer-layout-content" ;
5
+ import "./styles/sidebar-menu.scss" ;
6
+
7
+ const BasicDrawerLayout = ( ) => {
8
+ const childRef = useRef < { changeVisibility : ( ) => void } > ( null ) ;
9
+
10
+ return (
11
+ < DrawerLayout
12
+ ref = { childRef }
13
+ renderDrawerContent = { ( ) => (
14
+ < >
15
+ < div className = "sidebar sidebar-left sidebar-dark bg-dark" >
16
+ < ul className = "sidebar-menu" >
17
+ < li className = "sidebar-menu-item active" >
18
+ < a href = "#" className = "sidebar-menu-button" > Active menu item</ a >
19
+ </ li >
20
+
21
+ < li className = "sidebar-menu-item" >
22
+ < a href = "#" className = "sidebar-menu-button" > Regular menu item</ a >
23
+ </ li >
24
+
25
+ < li className = "sidebar-menu-item" >
26
+ < a className = "sidebar-menu-button" href = "#" >
27
+ < svg xmlns = "http://www.w3.org/2000/svg" fill = "none" viewBox = "0 0 24 24" strokeWidth = { 1.5 } stroke = "currentColor" className = "sidebar-menu-icon sidebar-menu-icon--left" >
28
+ < path strokeLinecap = "round" strokeLinejoin = "round" d = "M2.25 12l8.954-8.955c.44-.439 1.152-.439 1.591 0L21.75 12M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h8.25" />
29
+ </ svg >
30
+
31
+ Menu button text
32
+ </ a >
33
+ </ li >
34
+
35
+ < li className = "sidebar-menu-item" >
36
+ < a className = "sidebar-menu-button" href = "#" >
37
+ < i className = "sidebar-menu-icon sidebar-menu-icon--left material-icons" > home</ i >
38
+
39
+ Menu button text
40
+ </ a >
41
+ </ li >
42
+
43
+ < li className = "sidebar-menu-item open" >
44
+ < a href = "#" className = "sidebar-menu-button" >
45
+ Dashboard
46
+ < span className = "sidebar-menu-toggle-icon ms-auto" > </ span >
47
+ </ a >
48
+
49
+ < ul className = "sidebar-submenu" >
50
+ < li className = "sidebar-menu-item active" >
51
+ < a href = "#" className = "sidebar-menu-button" > Active menu item</ a >
52
+ </ li >
53
+ < li className = "sidebar-menu-item" >
54
+ < a href = "#" className = "sidebar-menu-button" > Regular menu item</ a >
55
+ </ li >
56
+ </ ul >
57
+ </ li >
58
+ </ ul >
59
+ </ div >
60
+
61
+ < div className = "sidebar sidebar-left sidebar-light" >
62
+ < ul className = "sidebar-menu" >
63
+ < li className = "sidebar-menu-item active" >
64
+ < a href = "#" className = "sidebar-menu-button" > Active menu item</ a >
65
+ </ li >
66
+
67
+ < li className = "sidebar-menu-item" >
68
+ < a href = "#" className = "sidebar-menu-button" > Regular menu item</ a >
69
+ </ li >
70
+
71
+ < li className = "sidebar-menu-item" >
72
+ < a className = "sidebar-menu-button" href = "#" >
73
+ < svg xmlns = "http://www.w3.org/2000/svg" fill = "none" viewBox = "0 0 24 24" strokeWidth = { 1.5 } stroke = "currentColor" className = "sidebar-menu-icon sidebar-menu-icon--left" >
74
+ < path strokeLinecap = "round" strokeLinejoin = "round" d = "M2.25 12l8.954-8.955c.44-.439 1.152-.439 1.591 0L21.75 12M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h8.25" />
75
+ </ svg >
76
+
77
+ Menu button text
78
+ </ a >
79
+ </ li >
80
+
81
+ < li className = "sidebar-menu-item" >
82
+ < a className = "sidebar-menu-button" href = "#" >
83
+ < i className = "sidebar-menu-icon sidebar-menu-icon--left material-icons" > home</ i >
84
+
85
+ Menu button text
86
+ </ a >
87
+ </ li >
88
+
89
+ < li className = "sidebar-menu-item open" >
90
+ < a href = "#" className = "sidebar-menu-button" >
91
+ Dashboard
92
+ < span className = "sidebar-menu-toggle-icon ms-auto" > </ span >
93
+ </ a >
94
+
95
+ < ul className = "sidebar-submenu" >
96
+ < li className = "sidebar-menu-item active" >
97
+ < a href = "#" className = "sidebar-menu-button" > Active menu item</ a >
98
+ </ li >
99
+ < li className = "sidebar-menu-item" >
100
+ < a href = "#" className = "sidebar-menu-button" > Regular menu item</ a >
101
+ </ li >
102
+ </ ul >
103
+ </ li >
104
+ </ ul >
105
+ </ div >
106
+ </ >
107
+ ) } >
108
+ < DrawerLayoutContent childRef = { childRef } />
109
+ </ DrawerLayout >
110
+ ) ;
111
+ }
112
+
113
+ export default BasicDrawerLayout ;
0 commit comments