import React, { PropTypes } from 'react' import { connect } from 'react-redux' import { bindActionCreators } from 'redux' import { Link, withRouter } from 'react-router' import Icon from './Icon' import Dropzones from './Dropzones' import Thumbnail from './Thumbnail' import FontAwesome from 'react-fontawesome' import * as mopidyActions from '../services/mopidy/actions' class Sidebar extends React.Component{ constructor(props) { super(props) } linkClassName(link){ if (this.props.location.pathname.startsWith('/'+link)){ return 'active' } else { return null } } render(){ return ( ); } } /** * Export our component * * We also integrate our global store, using connect() **/ const mapStateToProps = (state, ownProps) => { return { mopidy_connected: state.mopidy.connected, pusher_connected: state.pusher.connected, spotify_enabled: state.spotify.enabled, spotify_connected: state.spotify.connected, spotify_authorized: state.spotify.authorization, test_mode: (state.ui.test_mode ? state.ui.test_mode : false), dragger: state.ui.dragger } } const mapDispatchToProps = (dispatch) => { return { mopidyActions: bindActionCreators(mopidyActions, dispatch) } } // We wrap our Sidebar with the Router, and then to the redux store export default connect(mapStateToProps, mapDispatchToProps)(withRouter(Sidebar))