import React, { useEffect, useState } from "react"; import PropTypes from "prop-types"; import { MailSentContainer, Description, Footer, FooterText, FormContainer, SendAgainTextContainer, StandardText, Title, } from "./MailSent.styled"; import { ReactComponent as MailSentImage } from "../../../assets/images/svg/mail-sent.svg"; import { PrimaryButton } from "../../../components/Buttons/PrimaryButton/PrimaryButton"; import { NavLink, useHistory, useLocation } from "react-router-dom"; import Link from "../../../components/Link/Link"; import { Trans, useTranslation } from "react-i18next"; import { LOGIN_PAGE } from "../../../constants/pages"; import selectedTheme from "../../../themes"; import { useDispatch } from "react-redux"; import { forgotPassword } from "../../../store/actions/user/userActions"; const MailSent = () => { const [mail, setEmail] = useState(""); const { t } = useTranslation(); const history = useHistory(); const location = useLocation(); const dispatch = useDispatch(); useEffect(() => { setEmail(location.state.email); }, []); const navigateLogin = () => { history.replace(LOGIN_PAGE); }; const handleResend = () => { dispatch(forgotPassword({ email: mail })); }; return ( {t("forgotPassword.mailSent")} {t("forgotPassword.mailSentDescription")} {t("login.logIn")} {t("forgotPassword.notRecievedMail")} {t("common.sendAgain")} ); }; MailSent.propTypes = { children: PropTypes.node, }; export default MailSent;