diff options
| author | Jules Laplace <jules@okfoc.us> | 2017-03-19 04:00:24 +0100 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2017-03-19 04:00:24 +0100 |
| commit | 34691ba687be4adefb12864e49d5c5a357e1a74b (patch) | |
| tree | 70def60ada8d511d37ef0da49bdc8698d5672b74 /client/index.js | |
| parent | c548b3bd3f0de1a1a74606d60ef9fdd323792918 (diff) | |
create and update meals
Diffstat (limited to 'client/index.js')
| -rw-r--r-- | client/index.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/client/index.js b/client/index.js index caec5aa..55792c6 100644 --- a/client/index.js +++ b/client/index.js @@ -2,5 +2,13 @@ import React from 'react'; import ReactDOM from 'react-dom'; import App from './components/App.jsx'; +const is_iphone = (navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) +const is_ipad = (navigator.userAgent.match(/iPad/i)) +const is_android = (navigator.userAgent.match(/Android/i)) +const is_mobile = is_iphone || is_ipad || is_android +const is_desktop = ! is_mobile + +document.body.classList.add(is_desktop ? 'desktop' : 'mobile') + ReactDOM.render(<App />, document.getElementById('container')); |
