From f69b8752a6889947cafd9c549f259786eab70153 Mon Sep 17 00:00:00 2001 From: Unknown Date: Tue, 13 Nov 2018 03:32:22 +0100 Subject: [PATCH] Adding a home button for mobile menu --- client/src/styles/styles.scss | 2 +- client/src/views/layout/header/imports.js | 5 +++++ client/src/views/layout/header/index.js | 17 ++++++++++++----- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/client/src/styles/styles.scss b/client/src/styles/styles.scss index 24f0c3dd6..b09fabb19 100644 --- a/client/src/styles/styles.scss +++ b/client/src/styles/styles.scss @@ -212,7 +212,7 @@ header.menu{ border: solid white; border-width: 0 2px 2px 0; padding: 3px; - margin-top: 18px; + margin-top: -32px; margin-right: 7px; transform: rotate(45deg); -webkit-transform: rotate(45deg); diff --git a/client/src/views/layout/header/imports.js b/client/src/views/layout/header/imports.js index badac9507..cdb3a7e7e 100644 --- a/client/src/views/layout/header/imports.js +++ b/client/src/views/layout/header/imports.js @@ -9,12 +9,14 @@ import { Group, Adb, VpnKey, + Home, AddCircleOutline } from '@material-ui/icons' const usersMenus = { title: 'Users', to: '/users', + icon: Home, submenus: [ { title: 'Directory', to: '/users/browse', icon: ImportContacts }, { title: 'Search', to: '/users/search', icon: Search }, @@ -26,6 +28,7 @@ const usersMenus = { const teamsMenus = { title: 'Teams', to: '/teams', + icon: Home, submenus: [ { title: 'All teams', to: '/teams', icon: Search }, { title: 'Your teams', to: '/teams/manage-teams', icon: Group, authenticated: true }, @@ -38,6 +41,7 @@ const teamsMenus = { const eventsMenus = { title: 'Events', to: '/events', + icon: Home, submenus: [ { title: 'All events', to: '/events', icon: Search }, { title: 'Your events', to: '/events/my', icon: GamepadRounded, authenticated: true }, @@ -50,6 +54,7 @@ const eventsMenus = { const keyvaultMenus = { title: 'Key Vault', to: '/key-vault', + icon: Home, authenticated: true, submenus: [ { title: 'Manage keys', to: '/key-vault/browse', icon: VpnKey }, diff --git a/client/src/views/layout/header/index.js b/client/src/views/layout/header/index.js index f8b2746a5..007533c07 100644 --- a/client/src/views/layout/header/index.js +++ b/client/src/views/layout/header/index.js @@ -80,7 +80,7 @@ class Header extends Component { } let user = JSON.parse(this.state.user) - const menus = allMenus.map(({ to, title, submenus, authenticated }, index) => { + const menus = allMenus.map(({ icon: Icon, to, title, submenus, authenticated }, index) => { if (authenticated && !(this.state.user !== undefined && this.state.user !== null)) { return } @@ -91,20 +91,27 @@ class Header extends Component { key={index} className={openedMenu === index ? 'primaryLink hasChildren selected' : 'primaryLink hasChildren'} > - this.toggleMenuOpen(index, true)}> {title} + { bigScreen + ? this.toggleMenuOpen(index, true)}> {title} + : this.toggleMenuOpen(index, true)}> {title} + }