diff --git a/react/containers/NavBar/index.js b/react/containers/NavBar/index.js new file mode 100644 index 00000000..37153ad2 --- /dev/null +++ b/react/containers/NavBar/index.js @@ -0,0 +1,12 @@ +import { connect } from 'react-redux'; +import View from './view'; + +const mapStateToProps = ({ channel }) => { + return { + channelName : channel.loggedInChannel.name, + channelShortId: channel.loggedInChannel.shortId, + channelLongId : channel.loggedInChannel.longId, + }; +}; + +export default connect(mapStateToProps, null)(View); diff --git a/react/containers/NavBar/view.jsx b/react/containers/NavBar/view.jsx new file mode 100644 index 00000000..6f51d4b1 --- /dev/null +++ b/react/containers/NavBar/view.jsx @@ -0,0 +1,74 @@ +import React from 'react'; + +const VIEW = 'VIEW'; +const LOGOUT = 'LOGOUT'; + +class NavBar extends React.Component { + constructor (props) { + super(props); + this.state = { + selectedOption: '', + } + this.handleSelection = this.handleSelection.bind(this); + } + componentDidMount () { + // set first selected option + } + handleSelection (event) { + const value = event.target.selectedOptions[0].value; + switch (value) { + case 'logout': + break; + case 'view': + break; + default: + break; + } + } + render () { + return ( +
+ ); + } +} + +export default NavBar;