import 'babel-polyfill'

import React, { Component, PropTypes } from 'react'
import injectTapEventPlugin from 'react-tap-event-plugin'
import { Match } from 'react-router'

import Search from './containers/Search'
import Header from './containers/Header'
import Footer from './containers/Footer'

import { fullWhite } from 'material-ui/styles/colors'
import { getMuiTheme, MuiThemeProvider } from 'material-ui/styles'

// Needed for onTouchTap
// Can go away when react 1.0 release
// Check this repo:
// https://github.com/zilverline/react-tap-event-plugin
injectTapEventPlugin()

class App extends Component {

  constructor () {
    super()

    this.muiTheme = null
  }

  componentWillMount () {
    this.muiTheme = getMuiTheme({
      userAgent: this.props.userAgent,
      svgIcon: {
        color: fullWhite
      }
    })
  }

  render () {
    return (
      <MuiThemeProvider muiTheme={this.muiTheme}>
        <div className='buka'>
          <Header />
          <main className='buka__container'>
            <Match pattern='/' component={Search} />
          </main>
          <Footer />
        </div>
      </MuiThemeProvider>
    )
  }
}

App.propTypes = {
  userAgent: PropTypes.string.isRequired
}

export default App

import 'babel-polyfill'

import React, { PropTypes } from 'react'
import injectTapEventPlugin from 'react-tap-event-plugin'
import { Match } from 'react-router'

import Search from './containers/Search'
import Header from './containers/Header'
import Footer from './containers/Footer'

import { fullWhite } from 'material-ui/styles/colors'
import { getMuiTheme, MuiThemeProvider } from 'material-ui/styles'

// Needed for onTouchTap
// Can go away when react 1.0 release
// Check this repo:
// https://github.com/zilverline/react-tap-event-plugin
injectTapEventPlugin()

const App = ({ userAgent }) => {
  const muiTheme = getMuiTheme({
    userAgent: userAgent,
    svgIcon: {
      color: fullWhite
    }
  })

  return (
    <MuiThemeProvider muiTheme={muiTheme}>
      <div className='buka'>
        <Header />
        <main className='buka__container'>
          <Match pattern='/' component={Search} />
        </main>
        <Footer />
      </div>
    </MuiThemeProvider>
  )
}

App.propTypes = {
  userAgent: PropTypes.string.isRequired
}

export default App

switch to stateless App component