From cb3186395d2f83050cf63f61230e0dc5f5202598 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Wed, 15 Aug 2018 08:51:20 +0200 Subject: [PATCH] Added burguer icon to show sidebar on mobile devices --- package.json | 1 + src/common/MainHeader.js | 11 ++++- src/common/MainHeader.scss | 8 ++++ src/common/MenuLayout.js | 84 ++++++++++++++++++++++---------------- src/common/MenuLayout.scss | 21 ++++++++++ src/index.scss | 7 ++++ yarn.lock | 2 +- 7 files changed, 97 insertions(+), 37 deletions(-) diff --git a/package.json b/package.json index 804f8756..53e04ed3 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "axios": "^0.18.0", "bootstrap": "^4.1.1", "chart.js": "^2.7.2", + "classnames": "^2.2.6", "moment": "^2.22.2", "promise": "8.0.1", "prop-types": "^15.6.2", diff --git a/src/common/MainHeader.js b/src/common/MainHeader.js index d896bd5f..54261623 100644 --- a/src/common/MainHeader.js +++ b/src/common/MainHeader.js @@ -1,4 +1,5 @@ import plusIcon from '@fortawesome/fontawesome-free-solid/faPlus'; +import arrowIcon from '@fortawesome/fontawesome-free-solid/faChevronDown'; import FontAwesomeIcon from '@fortawesome/react-fontawesome'; import React from 'react'; import { Link, withRouter } from 'react-router-dom' @@ -6,6 +7,7 @@ import { Collapse, Nav, Navbar, NavbarBrand, NavbarToggler, NavItem, NavLink } f import ServersDropdown from '../servers/ServersDropdown'; import './MainHeader.scss'; import shlinkLogo from './shlink-logo-white.png'; +import classnames from 'classnames'; export class MainHeader extends React.Component { state = { isOpen: false }; @@ -24,13 +26,20 @@ export class MainHeader extends React.Component { render() { const { location } = this.props; const createServerPath = '/server/create'; + const toggleClass = classnames('main-header__toggle-icon', { + 'main-header__toggle-icon--opened': this.state.isOpen, + }); return ( Shlink Shlink - + + + + +