import React from 'react'; import ChannelLoginForm from 'containers/ChannelLoginForm'; import ChannelCreateForm from 'containers/ChannelCreateForm'; import * as states from 'constants/publish_channel_select_states'; class ChannelSelect extends React.Component { constructor (props) { super(props); this.toggleAnonymousPublish = this.toggleAnonymousPublish.bind(this); this.handleSelection = this.handleSelection.bind(this); } toggleAnonymousPublish (event) { const value = event.target.value; if (value === 'anonymous') { this.props.onPublishInChannelChange(false); } else { this.props.onPublishInChannelChange(true); } } handleSelection (event) { const selectedOption = event.target.selectedOptions[0].value; this.props.onChannelSelect(selectedOption); } render () { return (

{this.props.channelError}

{ this.props.publishInChannel && (
{ (this.props.selectedChannel === states.LOGIN) && } { (this.props.selectedChannel === states.CREATE) && }
)}
); } } export default ChannelSelect;