From cb9dc9d65e31a5f865416aa928ffaa4f32606fa7 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Tue, 14 Aug 2018 20:28:46 +0200 Subject: [PATCH 01/66] Added swipable menu --- package.json | 1 + src/App.js | 2 +- src/App.scss | 5 +++ src/common/AsideMenu.js | 25 ++++++----- src/common/AsideMenu.scss | 32 +++++++++---- src/common/MenuLayout.js | 77 ++++++++++++++++++++++---------- src/common/MenuLayout.scss | 12 +++++ src/index.scss | 6 +++ src/servers/DeleteServerModal.js | 8 +--- src/servers/prop-types/index.js | 8 ++++ yarn.lock | 11 +++++ 11 files changed, 139 insertions(+), 48 deletions(-) create mode 100644 src/common/MenuLayout.scss create mode 100644 src/servers/prop-types/index.js diff --git a/package.json b/package.json index 661710f9..804f8756 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "react-moment": "^0.7.6", "react-redux": "^5.0.7", "react-router-dom": "^4.2.2", + "react-swipeable": "^4.3.0", "react-tagsinput": "^3.19.0", "reactstrap": "^6.0.1", "redux": "^4.0.0", diff --git a/src/App.js b/src/App.js index 7741f913..75832867 100644 --- a/src/App.js +++ b/src/App.js @@ -9,7 +9,7 @@ import CreateServer from './servers/CreateServer'; export default class App extends React.Component { render() { return ( -
+
diff --git a/src/App.scss b/src/App.scss index 4244391b..8ee1b5ff 100644 --- a/src/App.scss +++ b/src/App.scss @@ -1,5 +1,10 @@ @import './utils/base'; +.app-container { + height: 100%; +} + .app { padding-top: $headerHeight; + height: 100%; } diff --git a/src/common/AsideMenu.js b/src/common/AsideMenu.js index db2e783e..9d1e552b 100644 --- a/src/common/AsideMenu.js +++ b/src/common/AsideMenu.js @@ -6,12 +6,23 @@ import { NavLink } from 'react-router-dom'; import DeleteServerButton from '../servers/DeleteServerButton'; import './AsideMenu.scss'; import PropTypes from 'prop-types'; +import { serverType } from '../servers/prop-types'; -export default function AsideMenu({ selectedServer }) { +const defaultProps = { + className: '', + showOnMobile: false, +}; +const propTypes = { + selectedServer: serverType, + className: PropTypes.string, + showOnMobile: PropTypes.bool, +}; + +export default function AsideMenu({ selectedServer, className, showOnMobile }) { const serverId = selectedServer ? selectedServer.id : ''; return ( -