2018-01-03 02:12:57 +01:00
|
|
|
import React from 'react';
|
2018-01-11 20:41:12 +01:00
|
|
|
import PreviewDropzone from './Dropzone.jsx';
|
2018-01-09 02:06:31 +01:00
|
|
|
import PublishForm from './PublishForm.jsx';
|
2018-01-11 20:41:12 +01:00
|
|
|
import PublishStatus from '../components/PublishStatus.jsx';
|
2018-01-09 02:06:31 +01:00
|
|
|
import {connect} from 'react-redux';
|
2018-01-03 02:12:57 +01:00
|
|
|
|
2018-01-06 03:26:57 +01:00
|
|
|
class PublishTool extends React.Component {
|
2018-01-03 02:12:57 +01:00
|
|
|
render () {
|
2018-01-12 00:37:32 +01:00
|
|
|
if (this.props.file) {
|
|
|
|
if (this.props.status) {
|
|
|
|
return (
|
|
|
|
<PublishStatus
|
|
|
|
status={this.props.status}
|
|
|
|
message={this.props.message}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
return <PublishForm />;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
return <PreviewDropzone />;
|
|
|
|
}
|
2018-01-03 02:12:57 +01:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2018-01-09 02:06:31 +01:00
|
|
|
const mapStateToProps = state => {
|
|
|
|
return {
|
2018-01-12 00:37:32 +01:00
|
|
|
file : state.file,
|
|
|
|
status : state.status.status,
|
|
|
|
message: state.status.message,
|
2018-01-09 02:06:31 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
export default connect(mapStateToProps, null)(PublishTool);
|