spee.ch/react/containers/ShowChannel/index.js
2018-02-02 18:16:18 -08:00

26 lines
759 B
JavaScript

import { connect } from 'react-redux';
import {updateChannelData} from 'actions/show';
import View from './view';
const mapStateToProps = ({ show }) => {
return {
requestName: show.channelRequest.name,
requestId : show.channelRequest.id,
name : show.showChannel.channelData.name,
shortId : show.showChannel.channelData.shortId,
longId : show.showChannel.channelData.longId,
};
};
const mapDispatchToProps = dispatch => {
return {
onChannelDataUpdate: (name, longId, shortId) => {
dispatch(updateChannelData(name, longId, shortId));
},
onChannelDataClear: () => {
dispatch(updateChannelData(null, null, null));
},
};
};
export default connect(mapStateToProps, mapDispatchToProps)(View);