summaryrefslogtreecommitdiff
path: root/lib/awprint/client/index.jsx
blob: 136f3ff737c69750f9d85bcec0849c1457c910eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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'))