From ca78165f70c8a8fa2359f4f4b43f7b92d62efae4 Mon Sep 17 00:00:00 2001 From: bill bittner Date: Thu, 18 Jan 2018 10:58:34 -0800 Subject: [PATCH] created NavBar container --- react/containers/NavBar/index.js | 12 ++++++ react/containers/NavBar/view.jsx | 74 ++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 react/containers/NavBar/index.js create mode 100644 react/containers/NavBar/view.jsx 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 ( +
+
+ + + Logo + Spee.ch logo + + + + Spee<h + + + + + + + + + + + + +
+ Open-source, decentralized image and video sharing. +
+
+ Publish + About + { this.props.loggedInChannelName ? ( + + ) : ( + Channel + )} +
+
+
+ ); + } +} + +export default NavBar;