lbry-desktop/ui/js/component/authOverlay/index.jsx

25 lines
742 B
React
Raw Normal View History

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),
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);