2018-02-02 04:36:08 +01:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import View from './view';
|
2018-02-07 19:52:09 +01:00
|
|
|
import { updateAssetClaimData, updateShowAssetError } from 'actions/show';
|
2018-02-02 04:36:08 +01:00
|
|
|
|
|
|
|
const mapStateToProps = ({ show }) => {
|
|
|
|
return {
|
2018-02-02 20:10:58 +01:00
|
|
|
modifier : show.assetRequest.modifier,
|
2018-02-07 19:52:09 +01:00
|
|
|
name : show.assetRequest.name,
|
2018-02-02 20:10:58 +01:00
|
|
|
extension: show.assetRequest.extension,
|
2018-02-07 19:52:09 +01:00
|
|
|
error : show.showAsset.error,
|
2018-02-07 04:00:52 +01:00
|
|
|
claimData: show.showAsset.claimData,
|
2018-02-02 04:36:08 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2018-02-03 03:16:18 +01:00
|
|
|
const mapDispatchToProps = dispatch => {
|
|
|
|
return {
|
2018-02-07 19:52:09 +01:00
|
|
|
onShowAssetError: (error) => {
|
|
|
|
dispatch(updateShowAssetError(error));
|
|
|
|
},
|
2018-02-05 02:43:02 +01:00
|
|
|
onAssetClaimDataUpdate: (claimData, shortId) => {
|
|
|
|
dispatch(updateAssetClaimData(claimData, shortId));
|
2018-02-07 19:52:09 +01:00
|
|
|
dispatch(updateShowAssetError(null)); // clear any errors
|
2018-02-03 03:16:18 +01:00
|
|
|
},
|
|
|
|
onAssetClaimDataClear: () => {
|
2018-02-05 02:43:02 +01:00
|
|
|
dispatch(updateAssetClaimData(null, null));
|
2018-02-07 19:52:09 +01:00
|
|
|
dispatch(updateShowAssetError(null)); // clear any errors
|
2018-02-03 03:16:18 +01:00
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(View);
|