2017-06-08 02:56:52 +02:00
|
|
|
import React from "react";
|
|
|
|
import * as modal from "constants/modal_types";
|
|
|
|
import { connect } from "react-redux";
|
|
|
|
import { doUserEmailDecline } from "actions/user";
|
|
|
|
import { doOpenModal } from "actions/app";
|
2017-06-01 18:20:12 +02:00
|
|
|
import {
|
|
|
|
selectAuthenticationIsPending,
|
2017-06-08 23:15:34 +02:00
|
|
|
selectUserHasEmail,
|
2017-06-08 02:56:52 +02:00
|
|
|
selectUserIsAuthRequested,
|
|
|
|
} from "selectors/user";
|
|
|
|
import AuthOverlay from "./view";
|
2017-06-01 18:20:12 +02:00
|
|
|
|
2017-06-08 02:56:52 +02:00
|
|
|
const select = state => ({
|
2017-06-08 23:15:34 +02:00
|
|
|
hasEmail: selectUserHasEmail(state),
|
2017-06-02 02:51:52 +02:00
|
|
|
isPending: selectAuthenticationIsPending(state),
|
2017-06-08 02:56:52 +02:00
|
|
|
isShowing: selectUserIsAuthRequested(state),
|
|
|
|
});
|
2017-06-01 18:20:12 +02:00
|
|
|
|
2017-06-08 02:56:52 +02:00
|
|
|
const perform = dispatch => ({
|
|
|
|
userEmailDecline: () => dispatch(doUserEmailDecline()),
|
|
|
|
openWelcomeModal: () => dispatch(doOpenModal(modal.WELCOME)),
|
|
|
|
});
|
2017-06-01 18:20:12 +02:00
|
|
|
|
2017-06-08 02:56:52 +02:00
|
|
|
export default connect(select, perform)(AuthOverlay);
|