diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2017-06-01 16:40:39 -0400 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2017-06-01 16:40:39 -0400 |
| commit | 1f9253253e1914fb09ec0b54201ad934870782d8 (patch) | |
| tree | 971bfb4fe52f148be562e578f50fd550fc931aab /lib/awprint/client/index.jsx | |
| parent | fb2bff393b7a5415fcdbeafa6413166be6451342 (diff) | |
very basic print client
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')) |
