spee.ch/react/components/PublishTool.jsx
2018-01-10 16:30:17 -08:00

29 lines
761 B
JavaScript

import React from 'react';
import PreviewDropzone from './PreviewDropzone.jsx';
import PublishForm from './PublishForm.jsx';
import PublishStatus from './PublishStatus.jsx';
import {connect} from 'react-redux';
class PublishTool extends React.Component {
constructor (props) {
super(props);
}
render () {
return (
<div className="row row--tall flex-container--column">
{ !this.props.file && <PreviewDropzone /> }
{ this.props.file && <PublishForm /> }
{ this.props.publishStatus && <PublishStatus /> }
</div>
);
}
};
const mapStateToProps = state => {
return {
file : state.file,
publishStatus: state.publishStatus,
};
};
export default connect(mapStateToProps, null)(PublishTool);