Css related fixes for centering navbar

This commit is contained in:
Imbus 2023-11-05 19:31:52 +01:00
parent 867eb24d5d
commit 075a684ee3

View file

@ -31,26 +31,34 @@ export function Navbar() {
let login_ctx = useContext(LoginContext);
return (
<div class="navbar bg-base-100 max-w-3xl max-w flex justify-around">
<A href={"/"} class="btn btn-ghost normal-case text-xl">FrostByte</A>
<Menu />
<A
href="#"
class="btn btn-ghost normal-case text-sm"
onClick={(b) => {
b.preventDefault();
if (login_ctx?.token() != "") {
localStorage.setItem("token", "");
localStorage.setItem("username", "");
login_ctx?.setToken("");
login_ctx?.setUsername("");
return;
}
modal_ctx?.setLoginModalOpen(true);
}}
>
{login_ctx?.token() != "" ? login_ctx?.username() : "Login"}
</A>
<div class="navbar bg-base-100 max-w-3xl max-w flex">
<div class="flex-1">
<A href={"/"} class="btn btn-ghost normal-case text-xl">
FrostByte
</A>
</div>
<div class="">
<Menu />
</div>
<div class="flex-1 justify-end">
<A
href="#"
class="btn btn-ghost normal-case text-sm"
onClick={(b) => {
b.preventDefault();
if (login_ctx?.token() != "") {
localStorage.setItem("token", "");
localStorage.setItem("username", "");
login_ctx?.setToken("");
login_ctx?.setUsername("");
return;
}
modal_ctx?.setLoginModalOpen(true);
}}
>
{login_ctx?.token() != "" ? login_ctx?.username() : "Login"}
</A>
</div>
</div>
);
}