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

30 lines
857 B
JavaScript
Raw Normal View History

2018-04-18 06:03:01 +02:00
import { selectPathAfterAuth } from 'lbry-redux';
import { connect } from 'react-redux';
2018-04-18 06:03:01 +02:00
import { doNavigate } from 'redux/actions/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);