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

27 lines
740 B
JavaScript
Raw Normal View History

import { connect } from 'react-redux';
import View from './view';
2018-02-03 03:16:18 +01:00
import { updateAssetClaimData } from 'actions/show';
const mapStateToProps = ({ show }) => {
return {
modifier : show.assetRequest.modifier,
claim : show.assetRequest.name,
extension: show.assetRequest.extension,
2018-02-05 02:43:02 +01:00
claimData: show.showAsset.claimData.data,
shortId : show.showAsset.claimData.shortId,
};
};
2018-02-03 03:16:18 +01:00
const mapDispatchToProps = dispatch => {
return {
2018-02-05 02:43:02 +01:00
onAssetClaimDataUpdate: (claimData, shortId) => {
dispatch(updateAssetClaimData(claimData, shortId));
2018-02-03 03:16:18 +01:00
},
onAssetClaimDataClear: () => {
2018-02-05 02:43:02 +01:00
dispatch(updateAssetClaimData(null, null));
2018-02-03 03:16:18 +01:00
},
};
};
export default connect(mapStateToProps, mapDispatchToProps)(View);