lbry-desktop/ui/js/page/auth/index.js

31 lines
886 B
JavaScript
Raw Normal View History

2017-07-19 01:00:13 +02:00
import React from "react";
import { doNavigate } from "actions/navigation";
2017-07-19 01:00:13 +02:00
import { connect } from "react-redux";
import { selectPathAfterAuth } from "selectors/navigation";
2017-07-19 01:00:13 +02:00
import {
selectAuthenticationIsPending,
selectEmailToVerify,
selectUserIsVerificationCandidate,
selectUser,
selectUserIsPending,
selectIdentityVerifyIsPending,
} from "selectors/user";
import AuthPage from "./view";
const select = state => ({
isPending:
selectAuthenticationIsPending(state) ||
selectUserIsPending(state) ||
selectIdentityVerifyIsPending(state),
email: selectEmailToVerify(state),
2017-07-19 17:09:40 +02:00
pathAfterAuth: selectPathAfterAuth(state),
2017-07-19 01:00:13 +02:00
user: selectUser(state),
isVerificationCandidate: selectUserIsVerificationCandidate(state),
});
const perform = dispatch => ({
2017-07-19 17:09:40 +02:00
navigate: path => dispatch(doNavigate(path)),
2017-07-19 01:00:13 +02:00
});
export default connect(select, perform)(AuthPage);