summaryrefslogtreecommitdiff
path: root/client/src/lib/components/header.js
blob: 38a708ac84770f8ed9df7c7745f86d63d82365ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import React, { Component } from 'react'
import {
  Image,
  StyleSheet,
  Text,
  View,
} from 'react-native'
import { Link } from 'react-router-dom'

import Touchable from './touchable'
import Nav from '../views/nav'

export default class ClearText extends Component {
  render() {
    return (
      <View style={styles.header}>
        <Nav location={this.props.location} min={0} max={3} />
        <Link to='/'>
          <Image source={require('../../img/logo.png')} resizeMode='contain' style={styles.logo} />
        </Link>
        <Nav location={this.props.location} min={3} max={6} />
      </View>
    )
  }
}

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

const styles = StyleSheet.create({
  header: {
    width: '100%',
    backgroundColor: 'black',
    paddingTop: isMobile ? 20 : 10,
    paddingBottom: isMobile ? 5 : 10,
    height: isMobile ? 40 : 100,
    flexDirection: 'row',
    justifyContent: 'space-around',
    alignItems: 'center',
  },

  logo: {
    flex: 2,
    marginTop: 0,
    height: isMobile ? 32 : 55,
    marginBottom: isMobile ? 5 : 10,
  },

})