2018-02-03 03:16:18 +01:00
|
|
|
import { connect } from 'react-redux';
|
2018-02-09 19:02:13 +01:00
|
|
|
import { updateChannelClaimsAsync } from 'actions/show';
|
2018-02-03 03:16:18 +01:00
|
|
|
import View from './view';
|
|
|
|
|
2018-02-09 01:42:13 +01:00
|
|
|
const mapStateToProps = ({ show }) => {
|
2018-02-13 03:18:56 +01:00
|
|
|
let props = {};
|
|
|
|
// select channel key
|
|
|
|
const request = show.channelRequests[show.request.id];
|
|
|
|
const channelKey = `c#${request.name}#${request.longId}`;
|
|
|
|
props['channelKey'] = channelKey;
|
|
|
|
// select channel claims
|
|
|
|
const channel = show.channelList[channelKey];
|
|
|
|
if (channel) {
|
|
|
|
props['channel'] = channel;
|
2018-02-03 03:16:18 +01:00
|
|
|
};
|
2018-02-13 03:18:56 +01:00
|
|
|
return props;
|
2018-02-03 03:16:18 +01:00
|
|
|
};
|
|
|
|
|
2018-02-09 19:02:13 +01:00
|
|
|
const mapDispatchToProps = dispatch => {
|
|
|
|
return {
|
2018-02-13 03:18:56 +01:00
|
|
|
onChannelPageUpdate: (channelKey, name, longId, page) => {
|
|
|
|
dispatch(updateChannelClaimsAsync(channelKey, name, longId, page));
|
2018-02-09 19:02:13 +01:00
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
2018-02-03 03:16:18 +01:00
|
|
|
|
2018-02-09 19:02:13 +01:00
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(View);
|