import React from 'react'; import { useHistory } from "react-router-dom"; import Button from '@material-ui/core/Button'; import Typography from '@material-ui/core/Typography'; import { connect } from 'react-redux'; import { bindActionCreators, Dispatch } from 'redux'; import { resendVerificationEmail } from '../../reducers/auth/service'; import { selectAuthState } from '../../reducers/auth/selector'; import { IdentityProvider } from '@xr3ngine/common/src/interfaces/IdentityProvider'; import CardMedia from '@material-ui/core/CardMedia'; import { Trans, useTranslation } from "react-i18next"; // @ts-ignore import styles from '../../../socialmedia/components/Login/Login.module.scss'; const mapStateToProps = (state: any): any => { return { auth: selectAuthState(state) }; }; const mapDispatchToProps = (dispatch: Dispatch): any => ({ resendVerificationEmail: bindActionCreators(resendVerificationEmail, dispatch) }); interface Props { logo?: string; auth?: any; resendVerificationEmail?: typeof resendVerificationEmail; } const ConfirmEmail = (props: Props): any => { const history = useHistory(); const { auth, resendVerificationEmail } = props; const { t } = useTranslation(); const handleResendEmail = (e: any): any => { e.preventDefault(); const identityProvider = auth.get('identityProvider') as IdentityProvider; console.log('---------', identityProvider); resendVerificationEmail(identityProvider.token); }; return ( {t('user:auth.confirmEmail.header')} Please check your email to verify your account. If you didn't get an email, please click handleResendEmail(e)}>here to resend the verification email. Have an account? history.push('/login')}> Log in ); }; const ConfirmEmailWrapper = (props: Props): any => ; export default connect( mapStateToProps, mapDispatchToProps )(ConfirmEmailWrapper);
Have an account? history.push('/login')}> Log in