diff --git a/src/app.js b/src/app.js index fe71133..8b2655a 100644 --- a/src/app.js +++ b/src/app.js @@ -20,7 +20,6 @@ import { DndProvider } from 'react-dnd'; import HTML5Backend from 'react-dnd-html5-backend'; import NotificationSystem from 'react-notification-system'; import { Redirect, Route } from 'react-router-dom'; -import { Col } from 'react-bootstrap'; import { Hidden } from 'react-grid-system' import AppDispatcher from './common/app-dispatcher'; @@ -29,8 +28,7 @@ import NotificationsDataManager from './common/data-managers/notifications-data- import Home from './common/home'; import Header from './common/header'; import Footer from './common/footer'; -import SidebarMenu from './common/menu-sidebar'; -import HeaderMenu from './common/header-menu'; +import Menu from './common/menu'; import InfrastructureComponents from './ic/ics'; import Dashboard from './dashboard/dashboard'; @@ -51,9 +49,7 @@ class App extends React.Component { type: 'config/load', }); - this.state = { - showSidebarMenu: false, - } + this.state = {} } componentDidMount() { @@ -72,14 +68,6 @@ class App extends React.Component { } } - showSidebarMenu = () => { - this.setState({ showSidebarMenu: true }); - }; - - hideSidebarMenu = () => { - this.setState({ showSidebarMenu: false }); - }; - render() { let token = localStorage.getItem("token"); @@ -92,46 +80,32 @@ class App extends React.Component { let currentUser = JSON.parse(currentUserRaw); - return ( - -
- {/* - - */} - - - - - + return +
+ +
-
- +
+ -
- -
- - - - -
- - - - - - - - - -
+
+ + + + + + + + +
- -
+ +
- - ) + } } diff --git a/src/common/header-menu.js b/src/common/header-menu.js deleted file mode 100644 index b8d3e20..0000000 --- a/src/common/header-menu.js +++ /dev/null @@ -1,40 +0,0 @@ -/** - * This file is part of VILLASweb. - * - * VILLASweb is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * VILLASweb is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with VILLASweb. If not, see . - ******************************************************************************/ - -import React from 'react'; -import { Button } from 'react-bootstrap'; -import { NavLink } from 'react-router-dom'; - -export default class HeaderMenu extends React.Component { - render() { - return
- - - -
    -
  • Home
  • -
  • Scenarios
  • -
  • Infrastructure
  • - { this.props.currentRole === 'Admin' ? -
  • Users
  • : '' - } -
  • Account
  • -
  • Logout
  • -
-
; - } -} diff --git a/src/common/header.js b/src/common/header.js index c5c71b7..c305d5f 100644 --- a/src/common/header.js +++ b/src/common/header.js @@ -25,18 +25,7 @@ class Header extends React.Component { render() { return (
- -

{config.instance} - {config.subtitle}

- - - - {this.props.showMenuButton && - - } - - +

{config.instance} - {config.subtitle}

); } diff --git a/src/common/menu-sidebar.js b/src/common/menu.js similarity index 94% rename from src/common/menu-sidebar.js rename to src/common/menu.js index 422786d..8ae8e3f 100644 --- a/src/common/menu-sidebar.js +++ b/src/common/menu.js @@ -65,10 +65,11 @@ class SidebarMenu extends React.Component { } render() { - if (this.state.externalAuth) { - return ( -
-

Menu

+ return ( +
+

Menu

+ + {this.state.externalAuth ?
  • Home
  • Scenarios
  • @@ -80,15 +81,7 @@ class SidebarMenu extends React.Component { Logout
  • API Browser
-
- ); - } - - return ( -
-

Menu

- -
    + :
    • Home
    • Scenarios
    • Infrastructure
    • @@ -98,7 +91,7 @@ class SidebarMenu extends React.Component {
    • Account
    • Logout
    • API Browser
    • -
    +
}
); } diff --git a/src/styles/app.css b/src/styles/app.css index 51dd687..7c50bcf 100644 --- a/src/styles/app.css +++ b/src/styles/app.css @@ -30,37 +30,18 @@ body { hyphens: auto; } -.app-body { - /*height: 100%;*/ -} - .app-header { width: 100%; - height: 60px; - padding: 10px 0 0 0; color: #527984; background-color: #fff; } .app-header h1 { - width: 100%; + padding: 5px 0; margin: 0; - - text-align: left; -} - -@media (min-width: 768px) { - .app-header h1 { - text-align: center !important; - } -} - -.app-header .menu-icon { - color: #818181; - right: 5px; - - padding: 6px 0 0 0; + width: 100%; + text-align: center; } .btn-link { @@ -83,12 +64,7 @@ body { } .app-body-spacing { - padding: 15px 5px 0px 5px; -} - -.app-body-spacing > div { - margin-left: 7px; - margin-right: 7px; + padding: 20px; } .app-content-fullscreen { @@ -96,7 +72,7 @@ body { } .app-content { - padding: 15px 20px; + padding: 15px 20px 20px 20px; width: auto; min-height: 300px; @@ -106,10 +82,8 @@ body { 0 9px 18px 0 rgba(0, 0, 0, 0.1); } -@media (min-width: 768px) { - .app-content-margin-left { - margin-left: 195px !important; - } +.app-content-margin-left { + margin-left: 180px !important; } .verticalhorizontal { @@ -122,8 +96,8 @@ body { /** * Menus */ -.menu-sidebar { - padding: 20px 25px 20px 25px; +.menu { + padding: 20px; width: 160px; float: left; @@ -132,12 +106,12 @@ body { 0 9px 18px 0 rgba(0, 0, 0, 0.1); } -.menu-sidebar a { +.menu a { color: #4d4d4d; text-decoration:none; } -.menu-sidebar a:hover, .menu-sidebar a:focus { +.menu a:hover, .menu a:focus { text-decoration:none; } @@ -145,17 +119,17 @@ body { font-weight: bold; } -.menu-sidebar ul { +.menu ul { padding-top: 10px; margin-bottom: 0; list-style: none; white-space: nowrap; } -.menu-sidebar li { +.menu li { margin: 5px 0; } -.menu-sidebar a::after { +.menu a::after { /* Trick to make menu items to be as wide as in bold */ display: block; content: attr(title); @@ -232,7 +206,7 @@ body { /** * Login select */ - .login-select { +.login-select { position: sticky; width: 300px; height: 150px;