|
| 1 | +import React, { useState } from 'react'; |
| 2 | +import Footer from '../Footer'; |
| 3 | + |
| 4 | +const UserRegistration: React.FC = () => { |
| 5 | + const [name, setName] = useState(''); |
| 6 | + const [email, setEmail] = useState(''); |
| 7 | + const [password, setPassword] = useState(''); |
| 8 | + const [confirmPassword, setConfirmPassword] = useState(''); |
| 9 | + |
| 10 | + const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => { |
| 11 | + e.preventDefault(); |
| 12 | + // Handle form submission logic here (e.g., register user with Firebase) |
| 13 | + console.log('Form submitted:', { name, email, password, confirmPassword }); |
| 14 | + }; |
| 15 | + |
| 16 | + return ( |
| 17 | + <section className="bg-gradient-to-r from-primary-color-dark to-secondary-color min-h-screen"> |
| 18 | + <div className="container mx-auto px-4 py-8"> |
| 19 | + <div className="flex justify-center items-center gap-10"> |
| 20 | + <div className="w-full md:w-1/2"> |
| 21 | + <div className="text-center my-12"> |
| 22 | + <img src="./assets/sixtus-logo.png" alt="Logo" className="w-30" /> |
| 23 | + </div> |
| 24 | + <div className="bg-white shadow-lg rounded-lg px-8 py-14"> |
| 25 | + <form className="form" id="signupForm" onSubmit={handleSubmit}> |
| 26 | + <h1 className="text-2xl font-bold text-primary-color mb-6">Create Account</h1> |
| 27 | + <div className="form-message form-message-error"></div> |
| 28 | + <div className="mb-4"> |
| 29 | + <input |
| 30 | + type="text" |
| 31 | + className="input-item block bg-aliceblue border-2 border-gray-300 rounded-md p-3 outline-none w-full transition duration-200" |
| 32 | + id="name" |
| 33 | + autoFocus |
| 34 | + autoComplete="on" |
| 35 | + placeholder="Name" |
| 36 | + value={name} |
| 37 | + onChange={(e) => setName(e.target.value)} |
| 38 | + required |
| 39 | + /> |
| 40 | + <span id="nameError" className="text-red-500 text-sm mt-1"></span> |
| 41 | + </div> |
| 42 | + <div className="mb-4"> |
| 43 | + <input |
| 44 | + type="email" |
| 45 | + className="input-item block bg-aliceblue border-2 border-gray-300 rounded-md p-3 outline-none w-full transition duration-200" |
| 46 | + id="email" |
| 47 | + autoComplete="on" |
| 48 | + placeholder="Email Address" |
| 49 | + value={email} |
| 50 | + onChange={(e) => setEmail(e.target.value)} |
| 51 | + required |
| 52 | + /> |
| 53 | + <span id="emailError" className="text-red-500 text-sm mt-1"></span> |
| 54 | + </div> |
| 55 | + <div className="mb-4"> |
| 56 | + <input |
| 57 | + type="password" |
| 58 | + className="input-item block bg-aliceblue border-2 border-gray-300 rounded-md p-3 outline-none w-full transition duration-200" |
| 59 | + id="password" |
| 60 | + autoComplete="on" |
| 61 | + placeholder="Password" |
| 62 | + value={password} |
| 63 | + onChange={(e) => setPassword(e.target.value)} |
| 64 | + required |
| 65 | + /> |
| 66 | + <span id="passwordError" className="text-red-500 text-sm mt-1"></span> |
| 67 | + </div> |
| 68 | + <div className="mb-4"> |
| 69 | + <input |
| 70 | + type="password" |
| 71 | + className="input-item block bg-aliceblue border-2 border-gray-300 rounded-md p-3 outline-none w-full transition duration-200" |
| 72 | + id="confirmPassword" |
| 73 | + autoComplete="on" |
| 74 | + placeholder="Confirm Password" |
| 75 | + value={confirmPassword} |
| 76 | + onChange={(e) => setConfirmPassword(e.target.value)} |
| 77 | + required |
| 78 | + /> |
| 79 | + <span id="confirmPasswordError" className="text-red-500 text-sm mt-1"></span> |
| 80 | + </div> |
| 81 | + <button className="bg-primary-color text-white font-bold text-lg cursor-pointer w-full py-4 px-8 rounded transition duration-200 my-4 hover:bg-primary-color-dark active:scale-98" type="submit">Sign up</button> |
| 82 | + <p className="text-gray-600 text-center"> |
| 83 | + Already have an Account? <a href="#" className="text-secondary-color hover:underline">Login in</a> |
| 84 | + </p> |
| 85 | + </form> |
| 86 | + </div> |
| 87 | + </div> |
| 88 | + <div className="w-0 md:w-1/2"> |
| 89 | + <div className="flex justify-center items-center w-full"> |
| 90 | + <img src="./assets/apple-laptop.png" width="450" height="300" alt="Laptop Image" className="mx-auto my-10" /> |
| 91 | + </div> |
| 92 | + </div> |
| 93 | + </div> |
| 94 | + </div> |
| 95 | + {/* Footer section */} |
| 96 | + <Footer /> |
| 97 | + </section> |
| 98 | + ); |
| 99 | +}; |
| 100 | + |
| 101 | +export default UserRegistration; |
0 commit comments