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

33 lines
850 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,
2018-09-24 05:44:42 +02:00
} from 'lbryinc';
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
});
2018-09-24 05:44:42 +02:00
export default connect(
select,
perform
)(AuthPage);