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