diff options
| author | jules <jules@carbonpictures.com> | 2017-06-01 23:41:32 +0000 |
|---|---|---|
| committer | jules <jules@carbonpictures.com> | 2017-06-01 23:41:32 +0000 |
| commit | 291a7be04a43ef0062a31dbfafb481c6e7829b79 (patch) | |
| tree | 018241c1b8b83ab9f802ab3805b1d3fc9429dfa4 /lib/awprint/client/index.jsx | |
| parent | 8e7adf087ad73228b1d463411b1a6bfc329fb625 (diff) | |
| parent | 1dec5a464d13129194c41342afb3f73386132245 (diff) | |
Merge branch 'master' of ghghgh.us:armory-fmf-cms
Diffstat (limited to 'lib/awprint/client/index.jsx')
| -rw-r--r-- | lib/awprint/client/index.jsx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/awprint/client/index.jsx b/lib/awprint/client/index.jsx new file mode 100644 index 0000000..136f3ff --- /dev/null +++ b/lib/awprint/client/index.jsx @@ -0,0 +1,13 @@ +import React from 'react' +import ReactDOM from 'react-dom' +import App from './components/App.jsx' + +const isIphone = (navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) +const isIpad = (navigator.userAgent.match(/iPad/i)) +const isAndroid = (navigator.userAgent.match(/Android/i)) +const isMobile = isIphone || isIpad || isAndroid +const isDesktop = ! isMobile + +document.body.classList.add(isDesktop ? 'desktop' : 'mobile') + +ReactDOM.render(<App />, document.getElementById('react-root')) |
