Skip to content

Commit efb2686

Browse files
committed
Add VSP to sidebar
1 parent c7d747e commit efb2686

File tree

3 files changed

+126
-85
lines changed

3 files changed

+126
-85
lines changed

src/_nav.js

Lines changed: 41 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from 'react'
22
import CIcon from '@coreui/icons-react'
3-
import {
3+
import
4+
{
45
cilBell,
56
cilCalculator,
67
cilChartPie,
@@ -20,7 +21,7 @@ const _nav = [
2021
component: CNavItem,
2122
name: 'Dashboard',
2223
to: '/dashboard',
23-
icon: <CIcon icon={cilSpeedometer} customClassName="nav-icon" />,
24+
icon: <CIcon icon={ cilSpeedometer } customClassName="nav-icon" />,
2425
badge: {
2526
color: 'info',
2627
text: 'NEW',
@@ -34,13 +35,40 @@ const _nav = [
3435
component: CNavItem,
3536
name: 'Colors',
3637
to: '/theme/colors',
37-
icon: <CIcon icon={cilDrop} customClassName="nav-icon" />,
38+
icon: <CIcon icon={ cilDrop } customClassName="nav-icon" />,
3839
},
3940
{
4041
component: CNavItem,
4142
name: 'Typography',
4243
to: '/theme/typography',
43-
icon: <CIcon icon={cilPencil} customClassName="nav-icon" />,
44+
icon: <CIcon icon={ cilPencil } customClassName="nav-icon" />,
45+
},
46+
{
47+
component: CNavTitle,
48+
name: 'Services',
49+
},
50+
{
51+
component: CNavGroup,
52+
name: 'Virtual Server Platform',
53+
to: '/services/virtual-server-platform',
54+
icon: <CIcon icon={ cilPuzzle } customClassName="nav-icon" />,
55+
items: [
56+
{
57+
component: CNavItem,
58+
name: 'Admin Tasks',
59+
to: '/services/virtual-server-platform/admin-tasks',
60+
},
61+
{
62+
component: CNavItem,
63+
name: 'Reports',
64+
to: '/services/virtual-server-platform/reports',
65+
},
66+
{
67+
component: CNavItem,
68+
name: 'Snapshots',
69+
to: '/services/virtual-server-platform/snapshots',
70+
}
71+
],
4472
},
4573
{
4674
component: CNavTitle,
@@ -50,7 +78,7 @@ const _nav = [
5078
component: CNavGroup,
5179
name: 'Base',
5280
to: '/base',
53-
icon: <CIcon icon={cilPuzzle} customClassName="nav-icon" />,
81+
icon: <CIcon icon={ cilPuzzle } customClassName="nav-icon" />,
5482
items: [
5583
{
5684
component: CNavItem,
@@ -133,7 +161,7 @@ const _nav = [
133161
component: CNavGroup,
134162
name: 'Buttons',
135163
to: '/buttons',
136-
icon: <CIcon icon={cilCursor} customClassName="nav-icon" />,
164+
icon: <CIcon icon={ cilCursor } customClassName="nav-icon" />,
137165
items: [
138166
{
139167
component: CNavItem,
@@ -155,7 +183,7 @@ const _nav = [
155183
{
156184
component: CNavGroup,
157185
name: 'Forms',
158-
icon: <CIcon icon={cilNotes} customClassName="nav-icon" />,
186+
icon: <CIcon icon={ cilNotes } customClassName="nav-icon" />,
159187
items: [
160188
{
161189
component: CNavItem,
@@ -203,12 +231,12 @@ const _nav = [
203231
component: CNavItem,
204232
name: 'Charts',
205233
to: '/charts',
206-
icon: <CIcon icon={cilChartPie} customClassName="nav-icon" />,
234+
icon: <CIcon icon={ cilChartPie } customClassName="nav-icon" />,
207235
},
208236
{
209237
component: CNavGroup,
210238
name: 'Icons',
211-
icon: <CIcon icon={cilStar} customClassName="nav-icon" />,
239+
icon: <CIcon icon={ cilStar } customClassName="nav-icon" />,
212240
items: [
213241
{
214242
component: CNavItem,
@@ -234,7 +262,7 @@ const _nav = [
234262
{
235263
component: CNavGroup,
236264
name: 'Notifications',
237-
icon: <CIcon icon={cilBell} customClassName="nav-icon" />,
265+
icon: <CIcon icon={ cilBell } customClassName="nav-icon" />,
238266
items: [
239267
{
240268
component: CNavItem,
@@ -262,7 +290,7 @@ const _nav = [
262290
component: CNavItem,
263291
name: 'Widgets',
264292
to: '/widgets',
265-
icon: <CIcon icon={cilCalculator} customClassName="nav-icon" />,
293+
icon: <CIcon icon={ cilCalculator } customClassName="nav-icon" />,
266294
badge: {
267295
color: 'info',
268296
text: 'NEW',
@@ -275,7 +303,7 @@ const _nav = [
275303
{
276304
component: CNavGroup,
277305
name: 'Pages',
278-
icon: <CIcon icon={cilStar} customClassName="nav-icon" />,
306+
icon: <CIcon icon={ cilStar } customClassName="nav-icon" />,
279307
items: [
280308
{
281309
component: CNavItem,
@@ -303,7 +331,7 @@ const _nav = [
303331
component: CNavItem,
304332
name: 'Docs',
305333
href: 'https://coreui.io/react/docs/templates/installation/',
306-
icon: <CIcon icon={cilDescription} customClassName="nav-icon" />,
334+
icon: <CIcon icon={ cilDescription } customClassName="nav-icon" />,
307335
},
308336
]
309337

src/components/AppSidebar.js

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import React from 'react'
22
import { useSelector, useDispatch } from 'react-redux'
33

4-
import {
4+
import
5+
{
56
CCloseButton,
67
CSidebar,
78
CSidebarBrand,
@@ -19,7 +20,8 @@ import { sygnet } from 'src/assets/brand/sygnet'
1920
// sidebar nav config
2021
import navigation from '../_nav'
2122

22-
const AppSidebar = () => {
23+
const AppSidebar = () =>
24+
{
2325
const dispatch = useDispatch()
2426
const unfoldable = useSelector((state) => state.sidebarUnfoldable)
2527
const sidebarShow = useSelector((state) => state.sidebarShow)
@@ -29,27 +31,30 @@ const AppSidebar = () => {
2931
className="border-end"
3032
colorScheme="dark"
3133
position="fixed"
32-
unfoldable={unfoldable}
33-
visible={sidebarShow}
34-
onVisibleChange={(visible) => {
34+
unfoldable={ unfoldable }
35+
visible={ sidebarShow }
36+
onVisibleChange={ (visible) =>
37+
{
3538
dispatch({ type: 'set', sidebarShow: visible })
36-
}}
39+
} }
3740
>
3841
<CSidebarHeader className="border-bottom">
3942
<CSidebarBrand to="/">
40-
<CIcon customClassName="sidebar-brand-full" icon={logo} height={32} />
41-
<CIcon customClassName="sidebar-brand-narrow" icon={sygnet} height={32} />
43+
<CIcon customClassName="sidebar-brand-full" icon={ logo } height={ 32 } />
44+
<CIcon customClassName="sidebar-brand-narrow" icon={ sygnet } height={ 32 } />
4245
</CSidebarBrand>
4346
<CCloseButton
4447
className="d-lg-none"
4548
dark
46-
onClick={() => dispatch({ type: 'set', sidebarShow: false })}
49+
onClick={ () => dispatch({ type: 'set', sidebarShow: false }) }
4750
/>
4851
</CSidebarHeader>
49-
<AppSidebarNav items={navigation} />
52+
53+
<AppSidebarNav items={ navigation } />
54+
5055
<CSidebarFooter className="border-top d-none d-lg-flex">
5156
<CSidebarToggler
52-
onClick={() => dispatch({ type: 'set', sidebarUnfoldable: !unfoldable })}
57+
onClick={ () => dispatch({ type: 'set', sidebarUnfoldable: !unfoldable }) }
5358
/>
5459
</CSidebarFooter>
5560
</CSidebar>

0 commit comments

Comments
 (0)