From 44557befbbb2028a990d3e49b3f6d1d19a1f3b9d Mon Sep 17 00:00:00 2001 From: bill bittner Date: Wed, 17 Jan 2018 09:46:16 -0800 Subject: [PATCH] fixed spacing around publish button --- react/components/ChannelSelector.jsx | 70 --------------------------- react/containers/ChannelSelect.jsx | 72 +++++++++++++++++++++++----- react/containers/PublishForm.jsx | 39 +++++---------- 3 files changed, 72 insertions(+), 109 deletions(-) delete mode 100644 react/components/ChannelSelector.jsx diff --git a/react/components/ChannelSelector.jsx b/react/components/ChannelSelector.jsx deleted file mode 100644 index 9fe7e257..00000000 --- a/react/components/ChannelSelector.jsx +++ /dev/null @@ -1,70 +0,0 @@ -import React from 'react'; -import { connect } from 'react-redux'; -import ChannelLoginForm from '../containers/ChannelLoginForm.jsx'; -import ChannelCreateForm from '../containers/ChannelCreateForm.jsx'; - -const LOGIN = 'Existing'; -const CREATE = 'New'; - -class ChannelSelector extends React.Component { - constructor (props) { - super(props); - this.state = { - selectedOption: LOGIN, - }; - this.handleSelection = this.handleSelection.bind(this); - this.selectOption = this.selectOption.bind(this); - } - componentWillMount () { - console.log('ChannelSelector will mount'); - if (this.props.loggedInChannelName) { - this.selectOption(this.props.loggedInChannelName); - } - } - componentWillReceiveProps ({ loggedInChannelName }) { - if (loggedInChannelName) { - this.selectOption(loggedInChannelName); - } - } - handleSelection (event) { - const selectedOption = event.target.selectedOptions[0].value; - this.selectOption(selectedOption); - } - selectOption (option) { - this.setState({selectedOption: option}); - } - render () { - return ( -
- { this.props.publishInChannel && ( -
-

{this.props.channelError}

-
- -
- -
- - { (this.state.selectedOption === LOGIN) && } - - { (this.state.selectedOption === CREATE) && } - -
- )} -
- ); - } -} - -const mapStateToProps = state => { - return { - loggedInChannelName: state.loggedInChannel.name, - publishInChannel : state.publishInChannel, - }; -}; - -export default connect(mapStateToProps, null)(ChannelSelector); diff --git a/react/containers/ChannelSelect.jsx b/react/containers/ChannelSelect.jsx index 3c74b3d2..45cda241 100644 --- a/react/containers/ChannelSelect.jsx +++ b/react/containers/ChannelSelect.jsx @@ -1,11 +1,31 @@ import React from 'react'; -import { setPublishInChannel } from '../actions/index'; -import { connect } from 'react-redux'; +import {setPublishInChannel} from '../actions'; +import {connect} from 'react-redux'; +import ChannelLoginForm from '../containers/ChannelLoginForm.jsx'; +import ChannelCreateForm from '../containers/ChannelCreateForm.jsx'; +const LOGIN = 'Existing'; +const CREATE = 'New'; class channelSelect extends React.Component { constructor (props) { super(props); + this.state = { + selectedOption: LOGIN, + }; this.toggleAnonymousPublish = this.toggleAnonymousPublish.bind(this); + this.handleSelection = this.handleSelection.bind(this); + this.selectOption = this.selectOption.bind(this); + } + componentWillMount () { + console.log('ChannelSelector will mount'); + if (this.props.loggedInChannelName) { + this.selectOption(this.props.loggedInChannelName); + } + } + componentWillReceiveProps ({ loggedInChannelName }) { + if (loggedInChannelName) { + this.selectOption(loggedInChannelName); + } } toggleAnonymousPublish (event) { const value = event.target.value; @@ -15,25 +35,51 @@ class channelSelect extends React.Component { this.props.onPublishInChannelChange(true); } } + handleSelection (event) { + const selectedOption = event.target.selectedOptions[0].value; + this.selectOption(selectedOption); + } + selectOption (option) { + this.setState({selectedOption: option}); + } render () { return ( -
-
- - -
-
- - -
-
+
+
+
+ + +
+
+ + +
+
+ { this.props.publishInChannel && ( +
+

{this.props.channelError}

+
+ +
+ +
+ { (this.state.selectedOption === LOGIN) && } + { (this.state.selectedOption === CREATE) && } +
+ )} +
); } } const mapStateToProps = state => { return { - publishInChannel: state.publishInChannel, + loggedInChannelName: state.loggedInChannel.name, + publishInChannel : state.publishInChannel, }; }; diff --git a/react/containers/PublishForm.jsx b/react/containers/PublishForm.jsx index 1ffcf3ff..7148ab92 100644 --- a/react/containers/PublishForm.jsx +++ b/react/containers/PublishForm.jsx @@ -1,14 +1,13 @@ import React from 'react'; -import { connect } from 'react-redux'; -import { getCookie } from '../utils/cookies.js'; +import {connect} from 'react-redux'; +import {selectFile, clearFile, updateLoggedInChannel, updatePublishStatus, updateError} from '../actions'; +import {getCookie} from '../utils/cookies.js'; import Dropzone from './Dropzone.jsx'; import PublishTitleInput from './PublishTitleInput.jsx'; -import ChannelSelector from '../components/ChannelSelector.jsx'; import PublishUrlInput from './PublishUrlInput.jsx'; import PublishThumbnailInput from './PublishThumbnailInput.jsx'; import PublishMetadataInputs from './PublishMetadataInputs.jsx'; -import AnonymousOrChannelSelect from './ChannelSelect.jsx'; -import {selectFile, clearFile, updateLoggedInChannel, updatePublishStatus, updateError} from '../actions'; +import ChannelSelect from './ChannelSelect.jsx'; import * as publishStates from '../constants/publishing_states'; class PublishForm extends React.Component { @@ -132,55 +131,43 @@ class PublishForm extends React.Component { return (
- -
-
-
-
- -
- -
-
- +
- { (this.props.file.type === 'video/mp4') && ( -
+
)} -
- -
-

{this.props.publishSubmitError}

+ { this.props.publishSubmitError && ( +
+

{this.props.publishSubmitError}

+
+ )} +
- -
+
-

By clicking 'Upload', you affirm that you have the rights to publish this content to the LBRY network, and that you understand the properties of publishing it to a decentralized, user-controlled network. Read more.

-