@@ -3,129 +3,33 @@ import { makeStyles, createStyles } from '@material-ui/core/styles'
3
3
import List from '@material-ui/core/List'
4
4
import ListSubheader from '@material-ui/core/ListSubheader'
5
5
6
- import IconProfile from '@material-ui/icons/AccountBox'
7
- import IconAdmin from '@material-ui/icons/VpnKey'
8
- import IconDashboard from '@material-ui/icons/Dashboard'
9
- import IconLibraryBooks from '@material-ui/icons/LibraryBooks'
10
- import IconQuestionAnswer from '@material-ui/icons/QuestionAnswer'
11
- import IconNewReleases from '@material-ui/icons/NewReleases'
12
- import IconSettings from '@material-ui/icons/Settings'
13
- import IconGroup from '@material-ui/icons/Group'
14
- import IconPreson from '@material-ui/icons/Person' //
15
-
16
- import NavList from './NavList'
17
-
18
- export interface ISidebarNavItem {
19
- name : string
20
- link ?: string
21
- Icon ?: any
22
- IconClassName ?: string
23
- items ?: ISidebarNavItem [ ]
24
- }
6
+ import { itemsCore , itemsTheme } from './SidebarNavService'
7
+ import SidebarNavListItem , { ISidebarNavListItem } from './SidebarNavListItem'
25
8
26
9
export interface ISidebarNavProps {
27
- isCollapsed ?: boolean
10
+ // isCollapsed?: boolean
28
11
}
29
12
30
13
const SidebarNav : React . FC < ISidebarNavProps > = ( props ) => {
31
- const { isCollapsed } = props
14
+ // const { isCollapsed } = props
32
15
const classes = useStyles ( )
33
16
34
- const itemsCore = [
35
- {
36
- name : 'Dashboard' ,
37
- link : '/' ,
38
- Icon : IconDashboard ,
39
- } ,
40
- {
41
- name : 'Auth' ,
42
- Icon : IconPreson ,
43
- items : [
44
- {
45
- name : 'Login' ,
46
- link : '/auth/login' ,
47
- } ,
48
- {
49
- name : 'Signup' ,
50
- link : '/auth/signup' ,
51
- } ,
52
- {
53
- name : 'Recover' ,
54
- link : '/auth/recover' ,
55
- } ,
56
- {
57
- name : 'Reset' ,
58
- link : '/auth/reset' ,
59
- } ,
60
- ] ,
61
- } ,
62
- {
63
- name : 'Account' ,
64
- Icon : IconProfile ,
65
- items : [
66
- {
67
- name : 'Profile' ,
68
- link : '/profile/me' ,
69
- } ,
70
- {
71
- name : 'Organization' ,
72
- link : '/organization' ,
73
- } ,
74
- ] ,
75
- } ,
76
- {
77
- name : 'Administration' ,
78
- Icon : IconAdmin ,
79
- items : [
80
- {
81
- name : 'Users' ,
82
- link : '/administration/users' ,
83
- Icon : IconGroup ,
84
- } ,
85
- ] ,
86
- } ,
87
- {
88
- name : 'Settings' ,
89
- link : '/settings' ,
90
- Icon : IconSettings ,
91
- } ,
92
- ]
93
-
94
- const itemsTheme = [
95
- {
96
- name : 'Why Modular?' ,
97
- link : '/demo/features' ,
98
- Icon : IconNewReleases ,
99
- IconClassName : classes . iconFeatures ,
100
- } ,
101
- {
102
- name : 'Docs' ,
103
- link : '/demo/docs' ,
104
- Icon : IconLibraryBooks ,
105
- IconClassName : classes . iconDocs ,
106
- } ,
107
- {
108
- name : 'Discuss' ,
109
- link : 'https://github.com/modularcode/modular-admin-react/discussions' ,
110
- Icon : IconQuestionAnswer ,
111
- IconClassName : classes . iconDiscuss ,
112
- } ,
113
- ]
114
-
115
17
return (
116
18
< div >
117
19
< List className = { classes . navList } disablePadding >
118
20
< ListSubheader disableSticky = { true } className = { classes . navListHeader } >
119
21
Core Modules
120
22
</ ListSubheader >
121
- < NavList isCollapsed = { isCollapsed } items = { itemsCore } />
122
23
</ List >
123
24
25
+ { itemsCore . map ( ( item : ISidebarNavListItem ) => {
26
+ return < SidebarNavListItem { ...item } />
27
+ } ) }
28
+
124
29
< List className = { classes . navList } disablePadding >
125
30
< ListSubheader disableSticky = { true } className = { classes . navListHeader } >
126
31
Misc
127
32
</ ListSubheader >
128
- < NavList isCollapsed = { isCollapsed } items = { itemsTheme } />
129
33
</ List >
130
34
</ div >
131
35
)
0 commit comments