import React, { useState } from 'react'; import Settings from './Settings'; // Import the Settings component const Login: React.FC = () => { // State to handle popup visibility const [showLoginPopup, setShowLoginPopup] = useState(false); const [showSignUpPopup, setShowSignUpPopup] = useState(false); const [isLoggedIn, setIsLoggedIn] = useState(false); const [showSettingsPopup, setShowSettingsPopup] = useState(false); // Credentials state const [email, setEmail] = useState(''); const [password, setPassword] = useState(''); const [accountName, setAccountName] = useState('Pluto'); // Set the account name const [newAccountEmail, setNewAccountEmail] = useState(''); const [newAccountPassword, setNewAccountPassword] = useState(''); // Fixed credentials const fixedEmail = 'pluto@imareal.planet'; const fixedPassword = 'fuckTheSun1234'; const fixedAccount = 'Pluto'; // Function to toggle the login popup const toggleLoginPopup = () => setShowLoginPopup(!showLoginPopup); // Function to toggle the sign-up popup const toggleSignUpPopup = () => { setShowSignUpPopup(!showSignUpPopup); setShowLoginPopup(false); // Hide login popup when opening the sign-up popup }; // Function to handle login const handleLogin = () => { if ((email === fixedEmail || accountName === fixedAccount) && password === fixedPassword) { setIsLoggedIn(true); // Successful login setShowLoginPopup(false); // Close the login popup } else { alert('Incorrect credentials'); } }; // Function to handle account creation const handleCreateAccount = () => { console.log('New Account Created:', newAccountEmail, newAccountPassword); alert('Account created successfully! You can now log in.'); toggleSignUpPopup(); // Close sign-up popup }; // Function to toggle the settings popup const toggleSettingsPopup = () => setShowSettingsPopup(!showSettingsPopup); return (
{/* Login or Settings Button */} {/* Conditional rendering of the Login Popup */} {showLoginPopup && (

Log In

{/* Close Button */} {/* Name or Email Input */}
setEmail(e.target.value)} />
{/* Password Input */}
setPassword(e.target.value)} />
{/* Log In Button */}
{/* Text for creating an account */}

Don't have an account yet? Create one {' '} here

)} {/* Conditional rendering of the Sign-Up Popup */} {showSignUpPopup && (

Create Account

{/* New Account Email Input */}
setNewAccountEmail(e.target.value)} />
{/* New Account Password Input */}
setNewAccountPassword(e.target.value)} />
{/* Create Account Button */}
{/* Close Button */}
)} {/* Conditional rendering of the Settings Popup */} {showSettingsPopup && }
); }; export default Login;