summaryrefslogtreecommitdiff
path: root/client/index.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2017-03-19 04:00:24 +0100
committerJules Laplace <jules@okfoc.us>2017-03-19 04:00:24 +0100
commit34691ba687be4adefb12864e49d5c5a357e1a74b (patch)
tree70def60ada8d511d37ef0da49bdc8698d5672b74 /client/index.js
parentc548b3bd3f0de1a1a74606d60ef9fdd323792918 (diff)
create and update meals
Diffstat (limited to 'client/index.js')
-rw-r--r--client/index.js8
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'));