diff --git a/react/containers/Dropzone/index.js b/react/containers/Dropzone/index.js index 07cc66e0..1faeb20c 100644 --- a/react/containers/Dropzone/index.js +++ b/react/containers/Dropzone/index.js @@ -1,5 +1,5 @@ import { connect } from 'react-redux'; -import { selectFile, updateError } from 'actions/publish'; +import { selectFile, updateError, clearFile } from 'actions/publish'; import View from './view'; const mapStateToProps = ({ publish }) => { @@ -12,13 +12,17 @@ const mapStateToProps = ({ publish }) => { const mapDispatchToProps = dispatch => { return { - onFileSelect: (file) => { + selectFile: (file) => { dispatch(selectFile(file)); dispatch(updateError('publishSubmit', null)); }, - onFileError: (value) => { + setFileError: (value) => { + dispatch(clearFile()); dispatch(updateError('file', value)); }, + clearFileError: () => { + dispatch(updateError('file', null)); + }, }; }; diff --git a/react/containers/Dropzone/view.jsx b/react/containers/Dropzone/view.jsx index 90b7c2a4..be5a9af1 100644 --- a/react/containers/Dropzone/view.jsx +++ b/react/containers/Dropzone/view.jsx @@ -74,20 +74,20 @@ class Dropzone extends React.Component { try { validateFile(file); // validate the file's name, type, and size } catch (error) { - return this.props.onFileError(error.message); + return this.props.setFileError(error.message); } // stage it so it will be ready when the publish button is clicked - this.props.onFileError(null); - this.props.onFileSelect(file); + this.props.clearFileError(null); + this.props.selectFile(file); } } render () { return ( -
+
- +
-
+
{this.props.file ? (
-
- { this.state.dragOver ? ( -
-

Drop it.

-
- ) : ( - null - )} - { this.state.mouseOver ? ( -
-

{this.props.fileError}

-

Drag & drop image or video here to publish

-

OR

-

CHOOSE FILE

-
- ) : ( - null - )} +
+ { this.state.dragOver ? ( +
+

Drop it.

+
+ ) : ( + null + )} + { this.state.mouseOver ? ( +
+

{this.props.fileError}

+

Drag & drop image or video here to publish

+

OR

+

CHOOSE FILE

+
+ ) : ( + null + )}
) : ( -
+
{ this.state.dragOver ? ( -
-

Drop it.

+
+

Drop it.

) : ( -
-

{this.props.fileError}

+
+

{this.props.fileError}

Drag & drop image or video here to publish

-

OR

-

CHOOSE FILE

+

OR

+

CHOOSE FILE

)}
diff --git a/react/containers/PublishForm/index.js b/react/containers/PublishForm/index.js index df1614b6..e0bc4473 100644 --- a/react/containers/PublishForm/index.js +++ b/react/containers/PublishForm/index.js @@ -1,6 +1,5 @@ import {connect} from 'react-redux'; -import {clearFile, selectFile, updateError, updatePublishStatus} from 'actions/publish'; -import {updateLoggedInChannel} from 'actions/channel'; +import {clearFile, updateError, updatePublishStatus} from 'actions/publish'; import View from './view'; const mapStateToProps = ({ channel, publish }) => { @@ -23,15 +22,9 @@ const mapStateToProps = ({ channel, publish }) => { const mapDispatchToProps = dispatch => { return { - onFileSelect: (file) => { - dispatch(selectFile(file)); - }, onFileClear: () => { dispatch(clearFile()); }, - onChannelLogin: (name, shortId, longId) => { - dispatch(updateLoggedInChannel(name, shortId, longId)); - }, onPublishStatusChange: (status, message) => { dispatch(updatePublishStatus(status, message)); }, diff --git a/react/containers/PublishForm/view.jsx b/react/containers/PublishForm/view.jsx index 366e86ba..45cf367d 100644 --- a/react/containers/PublishForm/view.jsx +++ b/react/containers/PublishForm/view.jsx @@ -128,39 +128,39 @@ class PublishForm extends React.Component { } render () { return ( -
-
+
+
-
-
+
+
-
-
-
+
+
+
-
+
{ (this.props.file.type === 'video/mp4') && ( -
+
)} -
+
-
- +
+
-
- +
+
-
-

By clicking 'Publish', 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.

+
+

By clicking 'Publish', 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.