lllll
This commit is contained in:
@@ -7,7 +7,7 @@ import './home.css';
|
||||
function Home({ isLoggedIn, setIsLoggedIn }) {
|
||||
const navigate = useNavigate();
|
||||
const [games, setGames] = useState([]);
|
||||
const { userId } = useContext(UserContext);
|
||||
const { userId, username } = useContext(UserContext);
|
||||
|
||||
useEffect(() => {
|
||||
if (isLoggedIn && userId) {
|
||||
@@ -27,27 +27,27 @@ function Home({ isLoggedIn, setIsLoggedIn }) {
|
||||
|
||||
return (
|
||||
<div className="container">
|
||||
<h2>Welcome to P&P-Master</h2>
|
||||
<h2>Willkommen zum P&P Manager {username}!</h2>
|
||||
{!isLoggedIn ? (
|
||||
<div className="button-group">
|
||||
<button className="btn" onClick={() => navigate('/login')}>Login</button>
|
||||
<button className="btn" onClick={() => navigate('/register')}>Register</button>
|
||||
<button className="btn" onClick={() => navigate('/login')}>Anmelden</button>
|
||||
<button className="btn" onClick={() => navigate('/register')}>Registrieren</button>
|
||||
</div>
|
||||
) : (
|
||||
<div className="content">
|
||||
<div className="button-group">
|
||||
<button className="btn" onClick={() => navigate('/startGame')}>Start Game</button>
|
||||
<button className="btn" onClick={() => navigate('/joinGame')}>Join Game</button>
|
||||
<button className="btn" onClick={handleLogout}>Logout</button>
|
||||
<button className="btn" onClick={() => navigate('/startGame')}>Starte Spiel</button>
|
||||
<button className="btn" onClick={() => navigate('/joinGame')}>Betrete Spiel</button>
|
||||
<button className="btn" onClick={handleLogout}>Ausloggen</button>
|
||||
</div>
|
||||
<div className="table-container">
|
||||
<h3>Your Games</h3>
|
||||
<h3>Deine Spiele:</h3>
|
||||
<table className="games-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Game ID</th>
|
||||
<th>Name</th>
|
||||
<th>Description</th>
|
||||
<th>Beschreibung</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
Reference in New Issue
Block a user