spee.ch/react/containers/PublishThumbnailInput/index.js
2018-02-05 18:14:12 -08:00

34 lines
1.1 KiB
JavaScript

import { connect } from 'react-redux';
import { updateThumbnailClaim, updateThumbnailFileOptions, updateThumbnailSelectedFile } from 'actions/publish';
import View from './view';
const mapStateToProps = ({ publish, site }) => {
return {
host : site.host,
// file props
publishFile : publish.file,
publishClaim : publish.claim,
// channel props
channel : publish.thumbnail.channel,
claim : publish.thumbnail.claim,
url : publish.thumbnail.url,
potentialFiles: publish.thumbnail.potentialFiles,
selectedFile : publish.thumbnail.selectedFile,
};
};
const mapDispatchToProps = dispatch => {
return {
onThumbnailClaimChange: (claim, url) => {
dispatch(updateThumbnailClaim(claim, url));
},
onThumbnailFileOptionsChange: (fileOne, fileTwo, fileThree) => {
dispatch(updateThumbnailFileOptions(fileOne, fileTwo, fileThree));
},
onThumbnailFileSelect: (file) => {
dispatch(updateThumbnailSelectedFile(file));
},
};
};
export default connect(mapStateToProps, mapDispatchToProps)(View);