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

28 lines
958 B
JavaScript
Raw Normal View History

2018-02-03 03:16:18 +01:00
import { connect } from 'react-redux';
import { updateChannelClaimsData } from 'actions/show';
import View from './view';
const mapStateToProps = ({ show }) => {
return {
2018-02-04 06:14:31 +01:00
name : show.showChannel.channelData.name,
longId : show.showChannel.channelData.longId,
2018-02-03 03:16:18 +01:00
claims : show.showChannel.channelClaimsData.claims,
currentPage: show.showChannel.channelClaimsData.currentPage,
totalPages : show.showChannel.channelClaimsData.totalPages,
totalClaims: show.showChannel.channelClaimsData.totalClaims,
};
};
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);