From b1e47ed2eb42b6e6da0f7bd49cdecaccc0cc90cd Mon Sep 17 00:00:00 2001 From: Lachlan Kermode Date: Mon, 11 Feb 2019 15:40:29 +0000 Subject: [PATCH] add stub to express lack of mobile functionality --- package.json | 1 + src/components/Dashboard.jsx | 20 ++++++++++++++++++++ yarn.lock | 5 +++++ 3 files changed, 26 insertions(+) diff --git a/package.json b/package.json index e04491f..f4526e9 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/components/Dashboard.jsx b/src/components/Dashboard.jsx index 3f971f8..133b744 100644 --- a/src/components/Dashboard.jsx +++ b/src/components/Dashboard.jsx @@ -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 ( +
+ {process.env.features.USE_COVER && ( + + {/* enable USE_COVER in config.js features, and customise your header */} + {/* pass 'actions.toggleCover' as a prop to your custom header */} + { + /* 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 */ + }} /> + + )} +
+ ) + } + return (