-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
client: update card styling, add forgot tab
- Loading branch information
Showing
9 changed files
with
103 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { useState } from "react" | ||
import { useAuthStore, AuthTab } from "../../../store/useAuthStore" | ||
// import { LoadingSVG } from "../../loading/svg" | ||
|
||
const ForgotPassword = () => { | ||
const { setAuthTab } = useAuthStore(); | ||
|
||
const [id, setID] = useState(''); | ||
const [isSubmitted, setIsSubmitted] = useState(false); | ||
const [validationState, setValidationState] = useState({ | ||
isIdValid: true, | ||
isOtpValid: true, | ||
isPasswordValid: true | ||
}); | ||
|
||
const handleForgotSubmit = (e: React.FormEvent<HTMLFormElement>) => { | ||
e.preventDefault(); | ||
setIsSubmitted(true); | ||
|
||
const trimmedId = id.trim(); | ||
setID(trimmedId); | ||
setValidationState(prevState => ({ | ||
...prevState, | ||
isIdValid: !!trimmedId | ||
})); | ||
} | ||
|
||
return ( | ||
<div id='forgot'> | ||
<h3>Account Recover</h3> | ||
<form id='forgot-form' className='form__container' onSubmit={handleForgotSubmit}> | ||
<div className='input__container'> | ||
<p>Email or Username</p> | ||
<input | ||
name="id" | ||
value={id} | ||
onChange={e => setID(e.target.value)} | ||
className={`${isSubmitted && !validationState.isIdValid ? "shake" : ""}`} | ||
style={{ borderColor: isSubmitted && !validationState.isIdValid ? "red" : "" }} | ||
placeholder='Enter your email or username' | ||
/> | ||
</div> | ||
<button type='submit'> | ||
{/* <LoadingSVG size={23} /> */} | ||
Check | ||
</button> | ||
<div className='extra-btn'> | ||
<p><span onClick={() => setAuthTab(AuthTab.Login)}>Go Back</span></p> | ||
</div> | ||
</form> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ForgotPassword; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters