Added already existing code for further development
This commit is contained in:
Marces Zastrow
2024-12-18 10:59:28 +01:00
commit dab55442be
2034 changed files with 264398 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
import React from 'react';
import { useNavigate } from 'react-router-dom';
function Home({ isLoggedIn, setIsLoggedIn }) {
const navigate = useNavigate();
const handleLogout = () => {
setIsLoggedIn(false);
};
return (
<div className="container">
<h2>Welcome to the Game</h2>
{!isLoggedIn ? (
<div className="button-group">
<button className="btn" onClick={() => navigate('/login')}>Login</button>
<button className="btn" onClick={() => navigate('/register')}>Register</button>
</div>
) : (
<div className="button-group">
<button className="btn" onClick={() => navigate('/start-game')}>Start Game</button>
<button className="btn" onClick={() => navigate('/join-game')}>Join Game</button>
<button className="btn" onClick={() => navigate('/continue-game')}>Continue Game</button>
<button className="btn" onClick={handleLogout}>Logout</button>
</div>
)}
</div>
);
}
export default Home;