2018-02-03 03:16:18 +01:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import { updateChannelClaimsData } from 'actions/show';
|
|
|
|
import View from './view';
|
|
|
|
|
2018-02-07 17:28:43 +01:00
|
|
|
const mapStateToProps = ({ show : { showChannel: { channelData, channelClaimsData } } }) => {
|
2018-02-03 03:16:18 +01:00
|
|
|
return {
|
2018-02-07 17:28:43 +01:00
|
|
|
name : channelData.name,
|
|
|
|
longId : channelData.longId,
|
|
|
|
claims : channelClaimsData.claims,
|
|
|
|
currentPage: channelClaimsData.currentPage,
|
|
|
|
totalPages : channelClaimsData.totalPages,
|
|
|
|
totalClaims: channelClaimsData.totalClaims,
|
2018-02-03 03:16:18 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
const mapDispatchToProps = dispatch => {
|
|
|
|
return {
|
|
|
|
onChannelClaimsDataUpdate: (claims, currentPage, totalPages, totalClaims) => {
|
|
|
|
dispatch(updateChannelClaimsData(claims, currentPage, totalPages, totalClaims));
|
|
|
|
},
|
|
|
|
onChannelClaimsDataClear: () => {
|
|
|
|
dispatch(updateChannelClaimsData(null, null, null, null));
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(View);
|