feat(login): support login with business email or phone number
This commit is contained in:
parent
f78cf6fe02
commit
120fdcc69a
1 changed files with 5 additions and 7 deletions
12
src/App.tsx
12
src/App.tsx
|
|
@ -460,10 +460,8 @@ export default function App() {
|
|||
const handleLoginSubmit = (e: React.FormEvent) => {
|
||||
e.preventDefault()
|
||||
|
||||
// Email Validation
|
||||
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
||||
if (!emailRegex.test(email)) {
|
||||
alert('Please enter a valid email address.');
|
||||
if (!email.trim()) {
|
||||
alert('Please enter your email or phone number.');
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -977,12 +975,12 @@ export default function App() {
|
|||
<form onSubmit={handleLoginSubmit}>
|
||||
<h2 className="form-card-title">Supplier Portal Access</h2>
|
||||
<div className="form-group">
|
||||
<label htmlFor="login-email">Business Email</label>
|
||||
<label htmlFor="login-email">Business Email or Phone Number</label>
|
||||
<input
|
||||
id="login-email"
|
||||
type="email"
|
||||
type="text"
|
||||
className="form-control"
|
||||
placeholder="Enter your email"
|
||||
placeholder="Enter your email or phone number"
|
||||
value={email}
|
||||
onChange={(e) => setEmail(e.target.value)}
|
||||
required
|
||||
|
|
|
|||
Loading…
Reference in a new issue