add stub to express lack of mobile functionality

This commit is contained in:
Lachlan Kermode
2019-02-11 15:40:29 +00:00
parent 0c0ba2fe1e
commit b1e47ed2eb
3 changed files with 26 additions and 0 deletions

View File

@@ -22,6 +22,7 @@
"object-hash": "^1.3.0",
"ramda": "^0.26.1",
"react": "^16.6.3",
"react-device-detect": "^1.6.2",
"react-dom": "^16.6.3",
"react-image": "^1.5.1",
"react-portal": "^4.2.0",

View File

@@ -18,6 +18,8 @@ import DefaultCover from './presentational/covers/Default'
import { parseDate } from '../js/utilities'
import { isMobile } from 'react-device-detect'
class Dashboard extends React.Component {
constructor (props) {
super(props)
@@ -95,6 +97,24 @@ class Dashboard extends React.Component {
render () {
const { actions, app, domain, ui } = this.props
if (isMobile || window.innerWidth < 1000) {
return (
<div>
{process.env.features.USE_COVER && (
<StaticPage showing={app.flags.isCover}>
{/* enable USE_COVER in config.js features, and customise your header */}
{/* pass 'actions.toggleCover' as a prop to your custom header */}
<DefaultCover showAppHandler={() => {
/* eslint-disable no-undef */
alert('This platform is not suitable for mobile. Please re-visit the site on a device with a larger screen.')
/* eslint-enable no-undef */
}} />
</StaticPage>
)}
</div>
)
}
return (
<div>
<Toolbar

View File

@@ -5549,6 +5549,11 @@ rc@^1.0.1, rc@^1.1.6, rc@^1.2.7:
minimist "^1.2.0"
strip-json-comments "~2.0.1"
react-device-detect@^1.6.2:
version "1.6.2"
resolved "https://registry.yarnpkg.com/react-device-detect/-/react-device-detect-1.6.2.tgz#2587e4d1dc15bdfce7a1bf5417624ecd2a2fc31f"
integrity sha512-XIBgwIfpGAknm7tXe/YNbx4ieIR7IyFI3KNfSQk4UjHVy97UHe/nB7iJj8R/dDsI+I/ZzPR4HJ39Gh5tI4nhxw==
react-dom@^16.6.3:
version "16.6.3"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.6.3.tgz#8fa7ba6883c85211b8da2d0efeffc9d3825cccc0"