content: import React from 'react';
  import { connect } from 'react-redux';
  import store from '../../store.js';
  import { LoginStates, fetchBoards, selectBoard } from '../../actions';
  import Picker from '../views/picker';
  
  var TrelloPickerContainer = React.createClass({
      handleBoardSelected: function(e){
          store.dispatch(selectBoard(e.target.value));
      },
      componentDidMount: function() {
          this.getBoards();
      },
      componentWillUpdate: function(){
          this.getBoards();
      },
      getBoards: function(){
          const state = store.getState();
          if(state.boardsState.isFetching === false) {
              store.dispatch(fetchBoards(state));
          }
      },
      render: function() {
          return ( this.props.loggedin
                ? <Picker 
                    items={this.props.boards} 
                    onItemSelected={this.handleBoardSelected} 
                    labelText="Select a board" />
                : <div></div>
              );
      }
  });
  
  const mapStateToProps = function(store) {
    return {
      loggedin: store.loginState.loginState === LoginStates.LOGIN,
      boards: store.boardsState.allBoards
    };
  }
  
  module.exports = connect(mapStateToProps)(TrelloPickerContainer);