2017-08-18 19:09:40 +02:00
|
|
|
import React from "react";
|
|
|
|
import { connect } from "react-redux";
|
|
|
|
import { doOpenModal } from "actions/app";
|
2017-08-30 14:48:32 +02:00
|
|
|
import * as settings from "constants/settings";
|
|
|
|
import { selectCurrentModal } from "selectors/app";
|
|
|
|
import { selectCurrentPage } from "selectors/navigation";
|
|
|
|
import { selectCostForCurrentPageUri } from "selectors/cost_info";
|
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-26 05:21:26 +02:00
|
|
|
import { selectBalance } from "selectors/wallet";
|
2017-08-18 19:09:40 +02:00
|
|
|
import ModalRouter from "./view";
|
|
|
|
|
|
|
|
const select = (state, props) => ({
|
2017-08-26 05:21:26 +02:00
|
|
|
balance: selectBalance(state),
|
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);
|