2017-12-21 22:08:54 +01:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import * as settings from 'constants/settings';
|
2018-04-19 18:51:18 +02:00
|
|
|
import {
|
|
|
|
doNotify,
|
|
|
|
selectCostForCurrentPageUri,
|
|
|
|
selectBalance,
|
|
|
|
selectCurrentPage,
|
|
|
|
selectNotification,
|
|
|
|
selectNotificationProps,
|
|
|
|
} from 'lbry-redux';
|
2017-12-21 22:08:54 +01:00
|
|
|
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
|
|
|
import { selectUser, selectUserIsVerificationCandidate } from 'redux/selectors/user';
|
2017-12-07 19:07:30 +01:00
|
|
|
|
2017-12-21 22:08:54 +01:00
|
|
|
import ModalRouter from './view';
|
2017-08-18 19:09:40 +02:00
|
|
|
|
2018-04-18 06:22:42 +02:00
|
|
|
const select = state => ({
|
2017-08-26 05:21:26 +02:00
|
|
|
balance: selectBalance(state),
|
2017-08-22 23:19:33 +02:00
|
|
|
showPageCost: selectCostForCurrentPageUri(state),
|
2017-08-21 05:06:26 +02:00
|
|
|
page: selectCurrentPage(state),
|
2017-12-07 19:07:30 +01:00
|
|
|
isVerificationCandidate: selectUserIsVerificationCandidate(state),
|
2017-12-21 22:08:54 +01:00
|
|
|
isCreditIntroAcknowledged: makeSelectClientSetting(settings.CREDIT_REQUIRED_ACKNOWLEDGED)(state),
|
|
|
|
isEmailCollectionAcknowledged: makeSelectClientSetting(settings.EMAIL_COLLECTION_ACKNOWLEDGED)(
|
|
|
|
state
|
|
|
|
),
|
|
|
|
isWelcomeAcknowledged: makeSelectClientSetting(settings.NEW_USER_ACKNOWLEDGED)(state),
|
2017-08-18 19:09:40 +02:00
|
|
|
user: selectUser(state),
|
2018-04-19 18:51:18 +02:00
|
|
|
notification: selectNotification(state),
|
|
|
|
notificationProps: selectNotificationProps(state),
|
2017-08-18 19:09:40 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
const perform = dispatch => ({
|
2018-04-19 18:51:18 +02:00
|
|
|
openModal: notification => dispatch(doNotify(notification)),
|
2017-08-18 19:09:40 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
export default connect(select, perform)(ModalRouter);
|