diff --git a/app/components/Header.tsx b/app/components/Header.tsx index 5cd5b98..2bd1ed5 100644 --- a/app/components/Header.tsx +++ b/app/components/Header.tsx @@ -12,88 +12,186 @@ interface Props { const Header = ({ user, route }: Props) => { return ( -
- + + +
); }; diff --git a/app/root.tsx b/app/root.tsx index dca0c2a..f1b7f37 100644 --- a/app/root.tsx +++ b/app/root.tsx @@ -1,11 +1,14 @@ import type { LinksFunction, MetaFunction } from "remix"; import { Links, LiveReload, Outlet, useCatch, Meta, Scripts } from "remix"; -import Header from "./components/Header"; import styles from "./tailwind.css"; +import headerStyles from "./styles/header.css"; export const links: LinksFunction = () => { - return [{ rel: "stylesheet", href: styles }]; + return [ + { rel: "stylesheet", href: styles }, + { rel: "stylesheet", href: headerStyles }, + ]; // return [ // { // rel: "stylesheet", @@ -56,7 +59,7 @@ function Document({ {title} - + {children} {process.env.NODE_ENV === "development" ? : null} diff --git a/app/routes/expenses/index.tsx b/app/routes/expenses/index.tsx index 677c0d6..2f677f7 100644 --- a/app/routes/expenses/index.tsx +++ b/app/routes/expenses/index.tsx @@ -29,7 +29,7 @@ export default function JokesIndexRoute() { const data = useLoaderData(); return ( -
+

Last expenses

@@ -50,7 +50,7 @@ export default function JokesIndexRoute() {
- {new Intl.DateTimeFormat("en", { + {new Intl.DateTimeFormat("it", { dateStyle: "short", timeStyle: "short", }).format(new Date(exp.createdAt))} @@ -90,7 +90,7 @@ export default function JokesIndexRoute() { > - New expense + New
diff --git a/app/styles/header.css b/app/styles/header.css new file mode 100644 index 0000000..db96769 --- /dev/null +++ b/app/styles/header.css @@ -0,0 +1,22 @@ +.drawer-toggle:not(:checked) ~ .drawer-side { + position: absolute; + top: 0; + left: 0; + max-width: 0; + overflow: hidden; +} + +.drawer-toggle:checked ~ .drawer-side { + position: fixed; + z-index: 100; + left: 0; + top: 0; + height: 100vh; + width: 100%; +} + +@media (min-width: 1024px) { + header.drawer { + overflow: visible; + } +}