From 6eb6083984de70f641b5a2a4a305d54259765912 Mon Sep 17 00:00:00 2001 From: Zac Ioannidis Date: Fri, 30 Oct 2020 16:00:20 +0000 Subject: [PATCH] Don't fall back when on tablet - Fix infopoup on top of screen, so the close button isn't obscured on small viewports --- src/components/Layout.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/Layout.js b/src/components/Layout.js index b759b3b..af73aee 100644 --- a/src/components/Layout.js +++ b/src/components/Layout.js @@ -23,7 +23,7 @@ import TemplateCover from './TemplateCover' import colors from '../common/global' import { binarySearch, insetSourceFrom } from '../common/utilities' -import { isMobile } from 'react-device-detect' +import { isMobileOnly } from 'react-device-detect' import Search from './Search.jsx' class Dashboard extends React.Component { @@ -263,7 +263,7 @@ class Dashboard extends React.Component { const { actions, app, domain, features } = this.props const dateHeight = 80 const padding = 2 - const checkMobile = (isMobile || window.innerWidth < 600) + const checkMobile = (isMobileOnly || window.innerWidth < 600) const popupStyles = { height: checkMobile ? '100vh' : 'fit-content', @@ -271,7 +271,7 @@ class Dashboard extends React.Component { width: checkMobile ? '100vw' : window.innerWidth > 768 ? '60vw' : `calc(100vw - var(--toolbar-width))`, maxWidth: checkMobile ? '100vw' : 600, maxHeight: checkMobile ? '100vh' : window.innerHeight > 768 ? `calc(100vh - ${app.timeline.dimensions.height}px - ${dateHeight}px)` : `100vh`, - left: checkMobile ? padding : 'inherit', + left: checkMobile ? padding : 'var(--toolbar-width)', top: 0, overflowY: 'scroll' } @@ -358,7 +358,7 @@ class Dashboard extends React.Component { isOpen={app.flags.isInfopopup} onClose={actions.toggleInfoPopup} /> - {this.renderIntroPopup(false)} + {this.renderIntroPopup(false, popupStyles)} {app.debug ?