spee.ch/client/containers/Dropzone/index.js
2018-03-16 10:34:26 -07:00

25 lines
606 B
JavaScript

import { connect } from 'react-redux';
import { selectFile, updateError, clearFile } from 'actions/publish';
import View from './view';
const mapStateToProps = ({ publish }) => {
return {
file : publish.file,
thumbnail: publish.thumbnail,
fileError: publish.error.file,
};
};
const mapDispatchToProps = dispatch => {
return {
selectFile: (file) => {
dispatch(selectFile(file));
},
setFileError: (value) => {
dispatch(clearFile());
dispatch(updateError('file', value));
},
};
};
export default connect(mapStateToProps, mapDispatchToProps)(View);