From cfb4b2b3bdff7cfc893e43d7cf099bd4b529fff5 Mon Sep 17 00:00:00 2001 From: David Arranz Date: Sun, 25 Aug 2024 22:20:38 +0200 Subject: [PATCH] . --- .../QuoteItemsSortableDataTable.tsx | 2 +- client/src/app/settings/edit.tsx | 8 +-- client/src/app/settings/layout.tsx | 10 +++- client/src/components/Layout/LayoutHeader.tsx | 49 +++++++++++++++---- 4 files changed, 50 insertions(+), 19 deletions(-) diff --git a/client/src/app/quotes/components/QuoteItemsSortableDataTable.tsx b/client/src/app/quotes/components/QuoteItemsSortableDataTable.tsx index fbf809e..93859e7 100644 --- a/client/src/app/quotes/components/QuoteItemsSortableDataTable.tsx +++ b/client/src/app/quotes/components/QuoteItemsSortableDataTable.tsx @@ -270,7 +270,7 @@ export function QuoteItemsSortableDataTable({ collisionDetection={closestCenter} > - + diff --git a/client/src/app/settings/edit.tsx b/client/src/app/settings/edit.tsx index 644ee08..b80f922 100644 --- a/client/src/app/settings/edit.tsx +++ b/client/src/app/settings/edit.tsx @@ -30,7 +30,7 @@ import { useSettings } from "./hooks"; type SettingsDataForm = IUpdateProfile_Request_DTO; export const SettingsEditor = () => { - const [activeSection, setActiveSection] = useState("quotes"); + const [activeSection, setActiveSection] = useState("profile"); const { useOne, useUpdate } = useSettings(); const { data, status, error: queryError } = useOne(); @@ -107,12 +107,6 @@ export const SettingsEditor = () => { return (
-
-

- -

-
-
{form.formState.errors.root?.message && ( diff --git a/client/src/app/settings/layout.tsx b/client/src/app/settings/layout.tsx index 7fb0af2..0e16be8 100644 --- a/client/src/app/settings/layout.tsx +++ b/client/src/app/settings/layout.tsx @@ -1,5 +1,6 @@ import { Layout, LayoutContent, LayoutHeader } from "@/components"; import { PropsWithChildren } from "react"; +import { Trans } from "react-i18next"; import { SettingsProvider } from "./SettingsContext"; export const SettingsLayout = ({ children }: PropsWithChildren) => { @@ -7,7 +8,14 @@ export const SettingsLayout = ({ children }: PropsWithChildren) => { - {children} + +
+

+ +

+
+ {children} +
); diff --git a/client/src/components/Layout/LayoutHeader.tsx b/client/src/components/Layout/LayoutHeader.tsx index 3a56a97..6eccdec 100644 --- a/client/src/components/Layout/LayoutHeader.tsx +++ b/client/src/components/Layout/LayoutHeader.tsx @@ -1,41 +1,70 @@ import { Button, Sheet, SheetContent, SheetTrigger } from "@/ui"; +import { cn } from "@/lib/utils"; import { MenuIcon, Package2Icon } from "lucide-react"; +import { useCallback } from "react"; import { Trans } from "react-i18next"; -import { Link } from "react-router-dom"; +import { Link, useLocation } from "react-router-dom"; import { UeckoLogo } from "../UeckoLogo"; import { UserButton } from "./components"; export const LayoutHeader = () => { + const location = useLocation(); + + const isActiveLink = useCallback( + (path: string) => location.pathname === path, + [location.pathname] + ); + return ( -
+