fix: added logout button back to phone version

This commit is contained in:
Lukian LEIZOUR 2025-04-18 21:02:40 +02:00
parent 4a687c3ba5
commit 4501f38b03
2 changed files with 17 additions and 2 deletions

View file

@ -45,9 +45,17 @@ export default function TopBar({ user }: { user: User | undefined }) {
<Link to="/channels">Channels</Link>
<Link to="/users">Users</Link>
{user ? (
<Link to={`/u/${user.username}`}>{user.username}</Link>
<div className="burger-menu-user">
<Link to={`/u/${user.username}`}>{user.username}</Link>
<button onClick={() => {
localStorage.removeItem("token")
window.location.reload()
}}>
Logout
</button>
</div>
) : (
<div>
<div className="burger-menu-user">
<Link to="/login">Login</Link>
<Link to="/register">Register</Link>
</div>

View file

@ -39,6 +39,13 @@
gap: 10px;
}
.burger-menu-user {
display: flex;
flex-direction: column;
align-items: center;
gap: 10px;
}
@media (max-width: 630px) {
.topbar {
flex-direction: column;