From ad6094387226b2c2a3b9ec5dca0294aea4df1d91 Mon Sep 17 00:00:00 2001 From: fcablik Date: Sat, 13 Jan 2024 19:23:20 +0100 Subject: [PATCH] another admin sidebar menu fixes - mobile view + boxes view + hiding base FE menu in admin's routes --- app/components/headers/header-base.tsx | 58 ++++++++++++++------------ app/root.tsx | 2 +- app/routes/admin.tsx | 18 ++++---- 3 files changed, 41 insertions(+), 37 deletions(-) diff --git a/app/components/headers/header-base.tsx b/app/components/headers/header-base.tsx index f5ba3c8..dacc77c 100644 --- a/app/components/headers/header-base.tsx +++ b/app/components/headers/header-base.tsx @@ -1,22 +1,22 @@ -import { Link, NavLink } from "@remix-run/react" -import { cn } from "#app/utils/misc.tsx" -import ThemeSwitcher from "../theme-switch.tsx" -import { Button } from "../ui/button.tsx" +import { Link, NavLink } from '@remix-run/react' +import { cn } from '#app/utils/misc.tsx' +import ThemeSwitcher from '../theme-switch.tsx' +import { Button } from '../ui/button.tsx' // import { useOptionalUser } from "#app/utils/user.ts" // import UserDropdown from "../dropdowns/dropdown-user.tsx" -export function HeaderBase() { - // const user = useOptionalUser() - const headerHeight = "h-[60px]" +export function HeaderBase({ routeAdmin }: { routeAdmin?: boolean }) { + // const user = useOptionalUser() + const headerHeight = 'h-[60px]' return ( -
+
- ) -} \ No newline at end of file + ) +} diff --git a/app/root.tsx b/app/root.tsx index 6cc7b5a..164bbc1 100644 --- a/app/root.tsx +++ b/app/root.tsx @@ -231,7 +231,7 @@ function App() { return ( - +
diff --git a/app/routes/admin.tsx b/app/routes/admin.tsx index 2e2c6c4..5a2d0e7 100644 --- a/app/routes/admin.tsx +++ b/app/routes/admin.tsx @@ -31,13 +31,13 @@ function SidebarMainNavLink({ }) { return (
{({ isActive }) => (
@@ -120,22 +120,20 @@ function SidebarNavLink({ export default function AdminRoute() { const user = useUser() - - const sidebarBoxBaseClasslist = - 'lg:flex lg:flex-col lg:justify-between lg:items-center rounded-3xl bg-foreground text-background' - const [isHovered, setIsHovered] = useState(false) const handleMouseOver = () => { setIsHovered(true) } - const handleMouseOut = () => { setTimeout(() => { setIsHovered(false) }, 300) } + const sidebarBoxBaseClasslist = + 'lg:flex lg:flex-col lg:justify-between lg:items-center rounded-2xl lg:rounded-3xl bg-foreground text-background' + return (
@@ -146,11 +144,11 @@ export default function AdminRoute() { )} >
-
+
logo
@@ -170,7 +168,7 @@ export default function AdminRoute() {
-
+