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

31 lines
900 B
JavaScript
Raw Normal View History

import React from 'react';
import { doNavigate } from 'redux/actions/navigation';
import { connect } from 'react-redux';
import { selectPathAfterAuth } from 'redux/selectors/navigation';
2017-07-19 01:00:13 +02:00
import {
selectAuthenticationIsPending,
selectEmailToVerify,
selectUserIsVerificationCandidate,
selectUser,
selectUserIsPending,
selectIdentityVerifyIsPending,
} from 'redux/selectors/user';
import AuthPage from './view';
2017-07-19 01:00:13 +02:00
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);