text: import React, { Component, PropTypes } from 'react'
  import { browserHistory, Router } from 'react-router'
  import { Provider } from 'react-redux'
  
  import { auth, storageKey } from 'lib/firebase'
  import { actions } from 'routes/Login'
  
  class AppContainer extends Component {
    static propTypes = {
      routes : PropTypes.array.isRequired,
      store  : PropTypes.object.isRequired
    }
  
    componentDidMount () {
      auth.onAuthStateChanged(user => {
        if (user) {
          window.localStorage.setItem(storageKey, user.uid)
          this.props.store.dispatch(actions.login(user))
        } else {
          window.localStorage.removeItem(storageKey)
          this.props.store.dispatch(actions.logout(user))
        }
      })
    }
  
    shouldComponentUpdate () {
      return false
    }
  
    render () {
      const { routes, store } = this.props
  
      return (
        <Provider store={store}>
          <div style={{ height: '100%' }}>
            <Router history={browserHistory} children={routes} />
          </div>
        </Provider>
      )
    }
  }
  
  export default AppContainer
  