feat(frontend): slightly better error page
This commit is contained in:
parent
0f51f01b34
commit
bb76c24017
4 changed files with 72 additions and 40 deletions
|
@ -1,11 +1,11 @@
|
|||
import { Link, useFetcher } from "@remix-run/react";
|
||||
import Meta from "~/lib/api/meta";
|
||||
import { User, UserSettings } from "~/lib/api/user";
|
||||
import Logo from "./Logo";
|
||||
|
||||
import { Nav, Navbar, NavDropdown } from "react-bootstrap";
|
||||
import { Nav, NavDropdown } from "react-bootstrap";
|
||||
import { BrightnessHigh, BrightnessHighFill, MoonFill } from "react-bootstrap-icons";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import BaseNavbar from "~/components/nav/BaseNavbar";
|
||||
|
||||
export default function MainNavbar({
|
||||
user,
|
||||
|
@ -49,36 +49,28 @@ export default function MainNavbar({
|
|||
const theme = settings.dark_mode ? "dark" : "light";
|
||||
|
||||
return (
|
||||
<Navbar expand="lg" className={`mb-4 mx-2 bg-${theme}`} color={theme} variant={theme}>
|
||||
<Navbar.Brand to="/" as={Link}>
|
||||
<Logo />
|
||||
</Navbar.Brand>
|
||||
<Navbar.Toggle aria-controls="main-navbar" />
|
||||
<Navbar.Collapse id="main-navbar">
|
||||
<Nav className="ms-auto">
|
||||
{userMenu}
|
||||
<fetcher.Form method="POST" action="/dark-mode">
|
||||
<NavDropdown
|
||||
title={
|
||||
<>
|
||||
<ThemeIcon /> {t("navbar.theme")}
|
||||
</>
|
||||
}
|
||||
align="end"
|
||||
>
|
||||
<NavDropdown.Item as="button" name="theme" value="auto" type="submit">
|
||||
{t("navbar.theme-auto")}
|
||||
</NavDropdown.Item>
|
||||
<NavDropdown.Item as="button" name="theme" value="dark" type="submit">
|
||||
{t("navbar.theme-dark")}
|
||||
</NavDropdown.Item>
|
||||
<NavDropdown.Item as="button" name="theme" value="light" type="submit">
|
||||
{t("navbar.theme-light")}
|
||||
</NavDropdown.Item>
|
||||
</NavDropdown>
|
||||
</fetcher.Form>
|
||||
</Nav>
|
||||
</Navbar.Collapse>
|
||||
</Navbar>
|
||||
<BaseNavbar theme={theme}>
|
||||
{userMenu}
|
||||
<fetcher.Form method="POST" action="/dark-mode">
|
||||
<NavDropdown
|
||||
title={
|
||||
<>
|
||||
<ThemeIcon /> {t("navbar.theme")}
|
||||
</>
|
||||
}
|
||||
align="end"
|
||||
>
|
||||
<NavDropdown.Item as="button" name="theme" value="auto" type="submit">
|
||||
{t("navbar.theme-auto")}
|
||||
</NavDropdown.Item>
|
||||
<NavDropdown.Item as="button" name="theme" value="dark" type="submit">
|
||||
{t("navbar.theme-dark")}
|
||||
</NavDropdown.Item>
|
||||
<NavDropdown.Item as="button" name="theme" value="light" type="submit">
|
||||
{t("navbar.theme-light")}
|
||||
</NavDropdown.Item>
|
||||
</NavDropdown>
|
||||
</fetcher.Form>
|
||||
</BaseNavbar>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue