import React from 'react'; const LOGIN = 'login'; const CREATE = 'create'; class ChannelLoginForm extends React.Component { constructor (props) { super(props); } render () { return (

Channel Login Form

); } } class ChannelCreateForm extends React.Component { constructor (props) { super(props); } render () { return (

Create Channel Form

); } } class ChannelSelector extends React.Component { constructor (props) { super(props); this.state = { displayCreateOrLogin: LOGIN, }; this.toggleCreateOrLogin = this.toggleCreateOrLogin.bind(this); } toggleCreateOrLogin (event) { const selectedOption = event.target.selectedOptions[0].value; if (selectedOption === 'login') { this.setState({ displayCreateOrLogin: LOGIN }); } else { this.setState({ displayCreateOrLogin: CREATE }); } } render () { return (
{ this.props.publishToChannel && (

{this.props.channelError}

{ (this.state.displayCreateOrLogin === LOGIN) ? : }
)}
); } } module.exports = ChannelSelector;