@@ -2,13 +2,9 @@ import React from 'react';
22import {
33 Drawer ,
44 IconButton ,
5- Divider ,
65 List ,
7- Typography ,
86 withStyles } from "@material-ui/core" ;
97import {
10- ChevronRight as ChevronRightIcon ,
11- ChevronLeft as ChevronLeftIcon ,
128 Home as HomeIcon ,
139 NotificationsNone as NotificationsIcon ,
1410 FormatSize as TypographyIcon ,
@@ -25,11 +21,12 @@ import SidebarLink from './components/SidebarLink';
2521import Dot from './components/Dot' ;
2622
2723const structure = [
28- { label : 'Dashboard' , link : '/app/dashboard' , icon : < HomeIcon /> } ,
29- { label : 'Typography' , link : '/app/typography' , icon : < TypographyIcon /> } ,
30- { label : 'Tables' , link : '/app/tables' , icon : < TableIcon /> } ,
31- { label : 'Notifications' , link : '/app/notifications' , icon : < NotificationsIcon /> } ,
24+ { id : 0 , label : 'Dashboard' , link : '/app/dashboard' , icon : < HomeIcon /> } ,
25+ { id : 1 , label : 'Typography' , link : '/app/typography' , icon : < TypographyIcon /> } ,
26+ { id : 2 , label : 'Tables' , link : '/app/tables' , icon : < TableIcon /> } ,
27+ { id : 3 , label : 'Notifications' , link : '/app/notifications' , icon : < NotificationsIcon /> } ,
3228 {
29+ id : 4 ,
3330 label : 'UI Elements' ,
3431 link : '/app/ui' ,
3532 icon : < UIElementsIcon /> ,
@@ -39,16 +36,16 @@ const structure = [
3936 { label : 'Maps' , link : '/app/ui/maps' } ,
4037 ] ,
4138 } ,
42- { type : 'divider' } ,
43- { type : 'title' , label : 'HELP' } ,
44- { label : 'Library' , link : '' , icon : < LibraryIcon /> } ,
45- { label : 'Support' , link : '' , icon : < SupportIcon /> } ,
46- { label : 'FAQ' , link : '' , icon : < FAQIcon /> } ,
47- { type : 'divider' } ,
48- { type : 'title' , label : 'PROJECTS' } ,
49- { label : 'My recent' , link : '' , icon : < Dot size = "large" color = "warning" /> } ,
50- { label : 'Starred' , link : '' , icon : < Dot size = "large" color = "primary" /> } ,
51- { label : 'Background' , link : '' , icon : < Dot size = "large" color = "secondary" /> } ,
39+ { id : 5 , type : 'divider' } ,
40+ { id : 6 , type : 'title' , label : 'HELP' } ,
41+ { id : 7 , label : 'Library' , link : '' , icon : < LibraryIcon /> } ,
42+ { id : 8 , label : 'Support' , link : '' , icon : < SupportIcon /> } ,
43+ { id : 9 , label : 'FAQ' , link : '' , icon : < FAQIcon /> } ,
44+ { id : 10 , type : 'divider' } ,
45+ { id : 11 , type : 'title' , label : 'PROJECTS' } ,
46+ { id : 12 , label : 'My recent' , link : '' , icon : < Dot size = "large" color = "warning" /> } ,
47+ { id : 13 , label : 'Starred' , link : '' , icon : < Dot size = "large" color = "primary" /> } ,
48+ { id : 14 , label : 'Background' , link : '' , icon : < Dot size = "large" color = "secondary" /> } ,
5249] ;
5350
5451const SidebarView = ( { classes, theme, toggleSidebar, isSidebarOpened, isPermanent } ) => {
@@ -70,14 +67,13 @@ const SidebarView = ({ classes, theme, toggleSidebar, isSidebarOpened, isPermane
7067 < div className = { classes . toolbar } />
7168 < div className = { classes . mobileBackButton } >
7269 < IconButton
73- color = "textSecondary"
7470 onClick = { toggleSidebar }
7571 >
7672 < ArrowBackIcon classes = { { root : classNames ( classes . headerIcon , classes . headerIconCollapse ) } } />
7773 </ IconButton >
7874 </ div >
7975 < List className = { classes . sidebarList } >
80- { structure . map ( link => < SidebarLink isSidebarOpened = { isSidebarOpened } key = { link && link . link || link . label } { ...link } /> ) }
76+ { structure . map ( link => < SidebarLink key = { link . id } isSidebarOpened = { isSidebarOpened } { ...link } /> ) }
8177 </ List >
8278 </ Drawer >
8379 ) ;
0 commit comments