2 * ============LICENSE_START========================================================================
3 * ONAP : ccsdk feature sdnr wt odlux
4 * =================================================================================================
5 * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
6 * =================================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
8 * in compliance with the License. You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software distributed under the License
13 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
14 * or implied. See the License for the specific language governing permissions and limitations under
16 * ============LICENSE_END==========================================================================
18 import * as React from 'react';
\r
19 import { withStyles, WithStyles, createStyles, Theme } from '@material-ui/core/styles';
\r
21 import { faHome, faAddressBook } from '@fortawesome/free-solid-svg-icons';
\r
23 import Drawer from '@material-ui/core/Drawer';
\r
24 import List from '@material-ui/core/List';
\r
26 import Divider from '@material-ui/core/Divider';
\r
28 import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
\r
30 import ListItemLink from '../components/material-ui/listItemLink';
\r
32 import connect, { Connect } from '../flux/connect';
\r
34 const drawerWidth = 240;
\r
36 const styles = (theme: Theme) => createStyles({
\r
38 position: 'relative',
\r
41 toolbar: theme.mixins.toolbar
\r
44 export const NavigationMenu = withStyles(styles)(connect()(({ classes, state }: WithStyles<typeof styles> & Connect) => {
\r
45 const { user } = state.framework.authenticationState
\r
50 paper: classes.drawerPaper,
\r
53 {user && user.isValid && <>
\r
54 <div className={classes.toolbar} />
\r
55 { /* https://fiffty.github.io/react-treeview-mui/ */}
\r
56 <List component="nav">
\r
57 <ListItemLink exact to="/" primary="Home" icon={<FontAwesomeIcon icon={faHome} />} />
\r
60 state.framework.applicationRegistraion && Object.keys(state.framework.applicationRegistraion).map(key => {
\r
61 const reg = state.framework.applicationRegistraion[key];
\r
65 to={reg.path || `/${reg.name}`}
\r
66 primary={reg.menuEntry || reg.name}
\r
67 secondary={reg.subMenuEntry}
\r
68 icon={reg.icon && <FontAwesomeIcon icon={reg.icon} /> || null} />
\r
73 <ListItemLink to="/about" primary="About" icon={<FontAwesomeIcon icon={faAddressBook} />} />
\r
80 export default NavigationMenu;