generated from Arquisoft/wiq_0
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extracted the components of the forgetPassword
- Loading branch information
1 parent
1c14d9e
commit eb6f182
Showing
5 changed files
with
138 additions
and
134 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import "../../custom.css"; | ||
|
||
export default function AskEmailUsername({ email, setEmail, username, setUsername, t, handleSubmit, showErrors }) { | ||
return ( | ||
<form className="form" onSubmit={handleSubmit}> | ||
<h1>{t("forgotPassword.enter_email")}</h1> | ||
{showErrors()} | ||
<div className="input-box"> | ||
<p>{t("addUser.email_placeholder")}: </p> | ||
<input | ||
name="email" | ||
type="text" | ||
placeholder={t("addUser.email_placeholder")} | ||
required | ||
value={email} | ||
onChange={(e) => setEmail(e.target.value)} | ||
/> | ||
</div> | ||
<div className="input-box"> | ||
<p>{t("addUser.username_placeholder")}: </p> | ||
<input | ||
name="username" | ||
type="text" | ||
placeholder={t("addUser.username_placeholder")} | ||
required | ||
value={username} | ||
onChange={(e) => setUsername(e.target.value)} | ||
/> | ||
</div> | ||
<button type="submit">{t("forgotPassword.enter_email_button")}</button> | ||
<br /> | ||
</form> | ||
); | ||
} |
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,20 @@ | ||
export default function EnterCode({ t, obtainCode, showErrors }) { | ||
return ( | ||
<div className="code"> | ||
<form className="form" onSubmit={obtainCode}> | ||
<h1>{t("forgotPassword.enter_code")}</h1> | ||
{showErrors()} | ||
<div className="codeGrid"> | ||
<input maxLength="1" className="input" type="text" placeholder="X"/> | ||
<input maxLength="1" className="input" type="text" placeholder="X"/> | ||
<input maxLength="1" className="input" type="text" placeholder="X"/> | ||
<input maxLength="1" className="input" type="text" placeholder="X"/> | ||
<input maxLength="1" className="input" type="text" placeholder="X"/> | ||
<input maxLength="1" className="input" type="text" placeholder="X"/> | ||
</div> | ||
<button type="submit">{t("forgotPassword.send_code")}</button> | ||
<br /> | ||
</form> | ||
</div> | ||
); | ||
} |
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,10 @@ | ||
|
||
export default function PendingComponent({ t }) { | ||
return ( | ||
<div className="form"> | ||
<h2>{t("forgotPassword.sending_title")}</h2> | ||
<p>{t("forgotPassword.sending_paragraph")}</p> | ||
</div> | ||
); | ||
} | ||
|
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,70 @@ | ||
export default function RestorePassword({ | ||
email, | ||
username, | ||
passwordStrength, | ||
passwordStrengthText, | ||
newPassword, | ||
handlePasswordChange, | ||
repeatPassword, | ||
setRepeatPassword, | ||
handleSubmit, | ||
t, | ||
showErrors | ||
}) { | ||
return ( | ||
<form className="form" onSubmit={handleSubmit}> | ||
<h1>{t("forgotPassword.enter_password")}</h1> | ||
{showErrors()} | ||
<div className="input-box"> | ||
<p>{t("addUser.email_placeholder")}: </p> | ||
<input | ||
name="email" | ||
type="text" | ||
required | ||
value={email} | ||
readOnly | ||
/> | ||
</div> | ||
<div className="input-box"> | ||
<p>{t("addUser.username_placeholder")}: </p> | ||
<input | ||
name="username" | ||
type="text" | ||
required | ||
value={username} | ||
readOnly | ||
/> | ||
</div> | ||
<div className="input-box-password-register"> | ||
<p>{t("addUser.password_placeholder")}: </p> | ||
<input | ||
name="password" | ||
type="password" | ||
required | ||
value={newPassword} | ||
onChange={handlePasswordChange} | ||
/> | ||
</div> | ||
<div className="password-strength-meter"> | ||
<span>{t(passwordStrengthText)}</span> | ||
<progress | ||
value={passwordStrength ? passwordStrength.score : 0} | ||
max="4" | ||
/> | ||
</div> | ||
<div className="input-box"> | ||
<p>{t("addUser.repeat_password_placeholder")}: </p> | ||
<input | ||
name="repeat_password" | ||
type="password" | ||
required | ||
value={repeatPassword} | ||
onChange={(e) => setRepeatPassword(e.target.value)} | ||
/> | ||
</div> | ||
<button type="submit">{t("forgotPassword.enter_password_button")}</button> | ||
<br /> | ||
</form > | ||
); | ||
} | ||
|