From 34691ba687be4adefb12864e49d5c5a357e1a74b Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sun, 19 Mar 2017 04:00:24 +0100 Subject: create and update meals --- client/index.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'client/index.js') 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(, document.getElementById('container')); -- cgit v1.2.3-70-g09d2