2017-12-21 22:08:54 +01:00
|
|
|
import { connect } from 'react-redux';
|
2018-10-29 18:23:53 +01:00
|
|
|
import { selectModal } from 'redux/selectors/app';
|
2019-12-18 06:27:08 +01:00
|
|
|
import { doOpenModal, doHideModal } from 'redux/actions/app';
|
2021-10-08 05:47:39 +02:00
|
|
|
import { selectError } from 'redux/selectors/notifications'; // RENAME THIS 'selectNotificationError'
|
2017-12-21 22:08:54 +01:00
|
|
|
import ModalRouter from './view';
|
2017-08-18 19:09:40 +02:00
|
|
|
|
2019-03-28 17:53:13 +01:00
|
|
|
const select = (state, props) => ({
|
2018-10-29 18:23:53 +01:00
|
|
|
modal: selectModal(state),
|
|
|
|
error: selectError(state),
|
2017-08-18 19:09:40 +02:00
|
|
|
});
|
|
|
|
|
2021-10-08 05:47:39 +02:00
|
|
|
const perform = (dispatch) => ({
|
|
|
|
openModal: (props) => dispatch(doOpenModal(props)),
|
|
|
|
hideModal: (props) => dispatch(doHideModal(props)),
|
2017-08-18 19:09:40 +02:00
|
|
|
});
|
|
|
|
|
2021-10-08 05:47:39 +02:00
|
|
|
export default connect(select, perform)(ModalRouter);
|