lbry-desktop/src/renderer/js/page/auth/index.js

31 lines
900 B
JavaScript
Raw Normal View History

2017-07-19 01:00:13 +02:00
import React from "react";
2017-11-13 22:02:23 +01:00
import { doNavigate } from "redux/actions/navigation";
2017-07-19 01:00:13 +02:00
import { connect } from "react-redux";
2017-11-13 22:02:23 +01:00
import { selectPathAfterAuth } from "redux/selectors/navigation";
2017-07-19 01:00:13 +02:00
import {
selectAuthenticationIsPending,
selectEmailToVerify,
selectUserIsVerificationCandidate,
selectUser,
selectUserIsPending,
selectIdentityVerifyIsPending,
2017-11-13 22:02:23 +01:00
} from "redux/selectors/user";
2017-07-19 01:00:13 +02:00
import AuthPage from "./view";
const select = state => ({
isPending:
selectAuthenticationIsPending(state) ||
2017-11-21 20:51:12 +01:00
selectUserIsPending(state) ||
selectIdentityVerifyIsPending(state),
2017-07-19 01:00:13 +02:00
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);