2017-08-18 19:09:40 +02:00
|
|
|
import React from "react";
|
|
|
|
import { connect } from "react-redux";
|
2017-08-21 05:06:26 +02:00
|
|
|
import { selectCurrentModal, selectCurrentPage } from "selectors/app";
|
2017-08-18 19:09:40 +02:00
|
|
|
import { doOpenModal } from "actions/app";
|
2017-08-21 05:06:26 +02:00
|
|
|
import { makeSelectClientSetting } from "selectors/settings";
|
2017-08-18 19:09:40 +02:00
|
|
|
import { selectUser } from "selectors/user";
|
2017-08-22 23:19:33 +02:00
|
|
|
import { selectCostForCurrentPageUri } from "selectors/cost_info";
|
2017-08-21 05:06:26 +02:00
|
|
|
import * as settings from "constants/settings";
|
2017-08-18 19:09:40 +02:00
|
|
|
import ModalRouter from "./view";
|
|
|
|
|
|
|
|
const select = (state, props) => ({
|
2017-08-22 23:19:33 +02:00
|
|
|
showPageCost: selectCostForCurrentPageUri(state),
|
2017-08-18 19:09:40 +02:00
|
|
|
modal: selectCurrentModal(state),
|
2017-08-21 05:06:26 +02:00
|
|
|
page: selectCurrentPage(state),
|
|
|
|
isWelcomeAcknowledged: makeSelectClientSetting(
|
|
|
|
settings.NEW_USER_ACKNOWLEDGED
|
|
|
|
)(state),
|
|
|
|
isCreditIntroAcknowledged: makeSelectClientSetting(
|
|
|
|
settings.CREDIT_INTRO_ACKNOWLEDGED
|
|
|
|
)(state),
|
2017-08-18 19:09:40 +02:00
|
|
|
user: selectUser(state),
|
|
|
|
});
|
|
|
|
|
|
|
|
const perform = dispatch => ({
|
2017-08-21 05:06:26 +02:00
|
|
|
openModal: modal => dispatch(doOpenModal(modal)),
|
2017-08-18 19:09:40 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
export default connect(select, perform)(ModalRouter);
|