import React, { useState } from 'react'; import Settings from './Settings'; // Import the Settings component const Login: React.FC = () => { // State to handle popup visibility const [showPopup, setShowPopup] = useState(false); const [showSignInPopup, setShowSignInPopup] = 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 // Function to toggle the popup const togglePopup = () => setShowPopup(!showPopup); // Function to toggle the sign-in popup const toggleSignInPopup = () => { setShowSignInPopup(!showSignInPopup); setShowPopup(false); // Hide login popup when opening the sign-in popup }; // Function to handle login const handleLogin = () => { if ((email === 'pluto@imareal.planet' || accountName === 'Pluto') && password === 'fuckTheSun1234') { setIsLoggedIn(true); // Successful login setShowSignInPopup(false); // Close the sign-in popup } else { alert('Incorrect credentials'); } }; // Function to toggle the settings popup const toggleSettingsPopup = () => setShowSettingsPopup(!showSettingsPopup); return (
{/* Login or Settings Button */}
{/* Conditional rendering of the initial Popup */} {showPopup && (

Register

{/* Name or Email Input */}
setEmail(e.target.value)} />
{/* Password Input (displayed as asterisks) */}
setPassword(e.target.value)} />
{/* Create Account and Sign In buttons */}

Already have an account? Sign in {' '} here

{/* Close Button */}
)} {/* Conditional rendering of the Sign-In Popup */} {showSignInPopup && (

Sign In

{/* Name or Email Input */}
setEmail(e.target.value)} />
{/* Password Input (displayed as asterisks) */}
setPassword(e.target.value)} />
{/* Log In Button */}
{/* Close Button */}
)} {/* Conditional rendering of the Settings Popup */} {showSettingsPopup && }
); }; export default Login;