From 8e432232c037e18505fdb0b5cca7c7ee665cbfdb Mon Sep 17 00:00:00 2001 From: Martina Date: Tue, 25 Aug 2020 21:13:02 -0700 Subject: [PATCH] made sidebar position absolute --- common/constants.js | 8 ++++---- components/core/ApplicationLayout.js | 25 +++++++++++++++++-------- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/common/constants.js b/common/constants.js index b4713c1d..1fefc824 100644 --- a/common/constants.js +++ b/common/constants.js @@ -27,10 +27,10 @@ export const system = { export const zindex = { navigation: 1, - sidebar: 2, + sidebar: 4, header: 3, - modal: 4, - tooltip: 5, + modal: 5, + tooltip: 6, }; export const font = { @@ -63,4 +63,4 @@ export const theme = { export const gateways = { ipfs: "ipfs.slate.textile.io", -} +}; diff --git a/components/core/ApplicationLayout.js b/components/core/ApplicationLayout.js index 9864ad5d..49e670f4 100644 --- a/components/core/ApplicationLayout.js +++ b/components/core/ApplicationLayout.js @@ -4,6 +4,7 @@ import * as SVG from "~/components/system/svg"; import { css } from "@emotion/react"; import { GlobalTooltip } from "~/components/system/components/fragments/GlobalTooltip"; +import { Boundary } from "~/components/system/components/fragments/Boundary"; const STYLES_SCROLL = css` -webkit-overflow-scrolling: touch; @@ -104,10 +105,15 @@ const STYLES_NAVIGATION = css` `; const STYLES_SIDEBAR_WEB = css` + z-index: ${Constants.zindex.sidebar}; height: 100vh; width: ${Constants.sizes.sidebar}px; padding: 0; flex-shrink: 0; + position: absolute; + background-color: ${Constants.system.foreground}; + top: 0; + right: 0; box-shadow: inset 1px 0 0 0 ${Constants.system.border}; ${STYLES_SCROLL} @media (max-width: ${Constants.sizes.mobile}px) { @@ -183,6 +189,7 @@ export default class ApplicationLayout extends React.Component { ref={(c) => { this._body = c; }} + id="slate-client-body" > {this.props.children} @@ -191,14 +198,16 @@ export default class ApplicationLayout extends React.Component { {this.props.sidebar ? ( -
{ - this._sidebar = c; - }} - > - {sidebarElements} -
+ +
{ + this._sidebar = c; + }} + > + {sidebarElements} +
+
) : null} );