Update email verification UI and functionality

Updated the user interface for the email verification component, refining the visual organization and style through updates to `verify_mail.tsx` and `VerifyMail.css`. Also, improved the functionality by enforcing a condition that validation code input must be numeric and not more than six characters long. Additionally, added more files to .gitignore to ignore debug files.
This commit is contained in:
Teriuihi 2024-01-14 09:52:21 +01:00
parent 49a71097bc
commit d02df0e418
3 changed files with 52 additions and 15 deletions

3
.gitignore vendored
View File

@ -21,3 +21,6 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*
**/DEBUG
**/DEBUG*

View File

@ -1,5 +1,30 @@
form {
max-width: 600px;
margin: auto;
padding: 20px;
}
.container {
flex-grow: 1;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.content {
max-width: 800px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.verification-code-input {
text-align: center;
max-width: 80px;
width: fit-content;
}
.submit-button {
margin-top: 20px;
}
header {
font-size: xx-large;
font-weight: bolder;
}

View File

@ -1,5 +1,6 @@
import {FC, useState} from "react";
import {useLocation, useNavigate} from "react-router-dom";
import './VerifyMail.css';
interface VerificationData {
eMail: string;
@ -66,16 +67,24 @@ const VerifyMail: FC = () => {
return (
<div className="container">
<p>Hi, you just completed a form and need to verify your email ({email}).</p>
<p>Please check your email for a verification code and enter it below:</p>
<input
type="text"
value={code}
onChange={(e) => setCode(e.target.value)}
className="verification-code-input"
/>
<button onClick={handleCodeSubmit} className="submit-button">Submit Code</button>
<header>Email validation</header>
<div className="content">
<p>Hi, you just completed a form and need to verify your email ({email}).</p>
<p>Please check your email for a verification code and enter it below:</p>
<input
type="text"
value={code}
onChange={(e) => {
if (/^\d{0,6}$/.test(e.target.value)) {
setCode(e.target.value);
}
}}
pattern="\d{6}"
maxLength={6}
className="verification-code-input"
/>
<button onClick={handleCodeSubmit} className="submit-button">Submit Code</button>
</div>
</div>
)
}