spee.ch/react/containers/Dropzone/index.js

26 lines
616 B
JavaScript
Raw Normal View History

2018-01-17 19:49:57 +01:00
import { connect } from 'react-redux';
import { selectFile, updateError } from '../../actions';
import View from './view.jsx';
const mapStateToProps = state => {
return {
file : state.file,
thumbnail: state.metadata.thumbnail,
fileError: state.error.file,
};
};
const mapDispatchToProps = dispatch => {
return {
onFileSelect: (file) => {
dispatch(selectFile(file));
dispatch(updateError('publishSubmit', null));
},
onFileError: (value) => {
dispatch(updateError('file', value));
},
};
};
export default connect(mapStateToProps, mapDispatchToProps)(View);