|
| 1 | +import React, { useState } from 'react'; |
| 2 | +import { Button } from '@radix-ui/react-button'; |
| 3 | +import { SunIcon, MoonIcon } from '@heroicons/react/solid'; |
| 4 | + |
| 5 | +const backgroundImageUrl = 'https://source.unsplash.com/random/1920x1080'; // Replace with desired URL from Unsplash |
| 6 | + |
| 7 | +const RegisterPage: React.FC = () => { |
| 8 | + const [darkMode, setDarkMode] = useState(false); |
| 9 | + |
| 10 | + const toggleDarkMode = () => { |
| 11 | + setDarkMode(!darkMode); |
| 12 | + if (darkMode) { |
| 13 | + document.documentElement.classList.remove('dark'); |
| 14 | + } else { |
| 15 | + document.documentElement.classList.add('dark'); |
| 16 | + } |
| 17 | + }; |
| 18 | + |
| 19 | + return ( |
| 20 | + <div className={`${darkMode ? 'dark' : ''} min-h-screen flex flex-col items-center justify-center bg-cover`} style={{ backgroundImage: `url(${backgroundImageUrl})` }}> |
| 21 | + <div className="absolute top-4 right-4"> |
| 22 | + <Button onClick={toggleDarkMode} className="p-2 bg-gray-800 text-white rounded-full"> |
| 23 | + {darkMode ? <SunIcon className="h-6 w-6" /> : <MoonIcon className="h-6 w-6" />} |
| 24 | + </Button> |
| 25 | + </div> |
| 26 | + <div className="bg-white dark:bg-gray-800 dark:text-white p-6 rounded-lg shadow-lg max-w-md w-full"> |
| 27 | + <h2 className="text-2xl font-bold mb-6 text-center">Create an account</h2> |
| 28 | + <form> |
| 29 | + <div className="mb-4"> |
| 30 | + <label className="block text-sm font-bold mb-2" htmlFor="email">Email</label> |
| 31 | + <input className="w-full p-2 border border-gray-300 rounded-lg dark:bg-gray-700 dark:border-gray-600" type="email" id="email" required /> |
| 32 | + </div> |
| 33 | + <div className="mb-4"> |
| 34 | + <label className="block text-sm font-bold mb-2" htmlFor="displayName">Display Name</label> |
| 35 | + <input className="w-full p-2 border border-gray-300 rounded-lg dark:bg-gray-700 dark:border-gray-600" type="text" id="displayName" required /> |
| 36 | + </div> |
| 37 | + <div className="mb-4"> |
| 38 | + <label className="block text-sm font-bold mb-2" htmlFor="username">Username</label> |
| 39 | + <input className="w-full p-2 border border-gray-300 rounded-lg dark:bg-gray-700 dark:border-gray-600" type="text" id="username" required /> |
| 40 | + </div> |
| 41 | + <div className="mb-4"> |
| 42 | + <label className="block text-sm font-bold mb-2" htmlFor="password">Password</label> |
| 43 | + <input className="w-full p-2 border border-gray-300 rounded-lg dark:bg-gray-700 dark:border-gray-600" type="password" id="password" required /> |
| 44 | + </div> |
| 45 | + <div className="flex items-center justify-between mb-6"> |
| 46 | + <Button className="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded" type="submit"> |
| 47 | + Continue |
| 48 | + </Button> |
| 49 | + </div> |
| 50 | + </form> |
| 51 | + <Button className="w-full bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded flex items-center justify-center"> |
| 52 | + <img src="https://upload.wikimedia.org/wikipedia/commons/4/4f/Google_Logo.png" alt="Google Logo" className="w-6 h-6 mr-2" /> |
| 53 | + Continue with Google |
| 54 | + </Button> |
| 55 | + </div> |
| 56 | + </div> |
| 57 | + ); |
| 58 | +}; |
| 59 | + |
| 60 | +export default RegisterPage; |
0 commit comments