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

27 lines
759 B
JavaScript
Raw Normal View History

import { connect } from 'react-redux';
2018-02-03 03:16:18 +01:00
import {updateChannelData} from 'actions/show';
import View from './view';
const mapStateToProps = ({ show }) => {
return {
requestName: show.channelRequest.name,
requestId : show.channelRequest.id,
2018-02-03 03:16:18 +01:00
name : show.showChannel.channelData.name,
shortId : show.showChannel.channelData.shortId,
longId : show.showChannel.channelData.longId,
};
};
2018-02-03 03:16:18 +01:00
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);