diff --git a/package.json b/package.json index 9ecf699c5..414dea211 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,6 @@ "moment": "^2.24.0", "proptypes": "^1.1.0", "react": "^16.8.6", - "react-burger-menu": "^2.6.13", "react-datepicker": "^2.12.1", "react-dom": "^16.8.6", "react-leaflet": "^2.4.0", diff --git a/src/components/main/menu/Menu.jsx b/src/components/main/menu/Menu.jsx index e6a0213cc..11ec99dc7 100644 --- a/src/components/main/menu/Menu.jsx +++ b/src/components/main/menu/Menu.jsx @@ -4,15 +4,15 @@ import React from 'react'; import PropTypes from 'proptypes'; import { connect } from 'react-redux'; -import { slide as Sidebar } from 'react-burger-menu'; +import clx from 'classnames'; import { toggleMenu as reduxToggleMenu, setMenuTab as reduxSetMenuTab, } from '@reducers/ui'; -import { MENU_TABS } from '@components/common/CONSTANTS'; -import Button from '../../common/Button'; +import { MENU_TABS } from '@components/common/CONSTANTS'; +import Button from '@components/common/Button'; import Submit from './Submit'; import DateSelector from './DateSelector/DateSelector'; import NCSelector from './NCSelector'; @@ -24,99 +24,40 @@ const Menu = ({ toggleMenu, setMenuTab, }) => { - const sidebarWidth = '509px'; - const tabs = [ MENU_TABS.MAP, MENU_TABS.VISUALIZATIONS, ]; - const handleActiveTab = tab => (tab === activeTab ? 'is-active' : ''); - return ( -
- - - +
+

Filters

+ + + + +
); }; diff --git a/src/styles/_base.scss b/src/styles/_base.scss index 04c1ddb5b..d84917d15 100644 --- a/src/styles/_base.scss +++ b/src/styles/_base.scss @@ -1,4 +1,10 @@ +// layout vars +$header-height: 60px; +$footer-height: 52px; +$menu-width: 509px; +$menu-transition: all 0.5s ease 0s; + h1 { font-family: $brand-heading-family; color: $brand-heading-color; diff --git a/src/styles/main/_menu.scss b/src/styles/main/_menu.scss new file mode 100644 index 000000000..9afe55db4 --- /dev/null +++ b/src/styles/main/_menu.scss @@ -0,0 +1,62 @@ +.menu-container { + $tabs-height: 40px; + + position: fixed; + left: 0; + top: $header-height; + bottom: $footer-height; + width: $menu-width; + z-index: 1100; + background: $brand-bg-color; + box-shadow: 0px 4px 5px rgba(108, 108, 108, 0.3); + transition: $menu-transition; + &:not(.open) { + transform: translateX(-100%); + } + + .menu-tabs { + .menu-tab { + width: 50%; + display: inline-block; + line-height: $tabs-height; + text-align: center; + background-color: #EEEEEE; + font-size: 18px; + color: #777777; + cursor: default; + &.active { + background-color: $brand-cta1-color; + font-weight: bold; + color: $brand-main-color; + } + &:not(.active) { + cursor: pointer; + } + } + } + + #btn-menu-toggle-button { + position: fixed; + left: $menu-width; + height: 60px; + width: 26px; + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); + border-radius: 0; + } + + .menu-content { + padding: 16px; + overflow: scroll; + height: calc(100% - #{$tabs-height}); + h1 { + margin-bottom: 8px; + } + #btn-sidebar-submit-button { + background-color: $brand-cta1-color; + color: $brand-text-color; + font-weight: 'bold'; + font-size: $brand-heading-size; + font-family: $brand-heading-family; + } + } +} diff --git a/src/styles/main/_visualizations.scss b/src/styles/main/_visualizations.scss index b969f088c..d61048bc0 100644 --- a/src/styles/main/_visualizations.scss +++ b/src/styles/main/_visualizations.scss @@ -1,9 +1,5 @@ .visualizations { - // these two values are coordinated with the sidebar menu - $menu-width: 509px; - $menu-transition: left 0.5s ease 0s; - $content-max-width: 840px; z-index: 1000; diff --git a/src/styles/styles.css b/src/styles/styles.css deleted file mode 100644 index 3d7742fbb..000000000 --- a/src/styles/styles.css +++ /dev/null @@ -1,3 +0,0 @@ -.sidebar-html-class, .sidebar-body-class { - overflow: hidden; -} \ No newline at end of file diff --git a/src/styles/styles.scss b/src/styles/styles.scss index df1effa3a..2b37e5c3b 100644 --- a/src/styles/styles.scss +++ b/src/styles/styles.scss @@ -4,6 +4,7 @@ @import './bulma'; @import './base'; +@import './main/menu'; @import './main/datepicker'; @import './main/tooltip'; @import './main/visualizations';