import {useState, useRef} from 'react' import {Link} from 'react-router-dom' import LandingIntro from './LandingIntro' import ErrorText from '../../components/Typography/ErrorText' import InputText from '../../components/Input/InputText' import CheckCircleIcon from '@heroicons/react/24/solid/CheckCircleIcon' function ForgotPassword(){ const INITIAL_USER_OBJ = { emailId : "" } const [loading, setLoading] = useState(false) const [errorMessage, setErrorMessage] = useState("") const [linkSent, setLinkSent] = useState(false) const [userObj, setUserObj] = useState(INITIAL_USER_OBJ) const submitForm = (e) =>{ e.preventDefault() setErrorMessage("") if(userObj.emailId.trim() === "")return setErrorMessage("Email Id is required! (use any value)") else{ setLoading(true) // Call API to send password reset link setLoading(false) setLinkSent(true) } } const updateFormValue = ({updateType, value}) => { setErrorMessage("") setUserObj({...userObj, [updateType] : value}) } return(
Link Sent
Check your email to reset password
> } { !linkSent && <>We will send password reset link on your email Id
> }