.
This commit is contained in:
parent
ffd35bee3b
commit
cfb4b2b3bd
@ -270,7 +270,7 @@ export function QuoteItemsSortableDataTable({
|
|||||||
collisionDetection={closestCenter}
|
collisionDetection={closestCenter}
|
||||||
>
|
>
|
||||||
<Card>
|
<Card>
|
||||||
<CardHeader className='sticky z-10 border-b top-16 bg-card'>
|
<CardHeader className='sticky z-10 top-16 bg-card/90'>
|
||||||
<CardTitle>
|
<CardTitle>
|
||||||
<QuoteItemsSortableDataTableToolbar table={table} />
|
<QuoteItemsSortableDataTableToolbar table={table} />
|
||||||
</CardTitle>
|
</CardTitle>
|
||||||
|
|||||||
@ -30,7 +30,7 @@ import { useSettings } from "./hooks";
|
|||||||
type SettingsDataForm = IUpdateProfile_Request_DTO;
|
type SettingsDataForm = IUpdateProfile_Request_DTO;
|
||||||
|
|
||||||
export const SettingsEditor = () => {
|
export const SettingsEditor = () => {
|
||||||
const [activeSection, setActiveSection] = useState("quotes");
|
const [activeSection, setActiveSection] = useState("profile");
|
||||||
const { useOne, useUpdate } = useSettings();
|
const { useOne, useUpdate } = useSettings();
|
||||||
|
|
||||||
const { data, status, error: queryError } = useOne();
|
const { data, status, error: queryError } = useOne();
|
||||||
@ -107,12 +107,6 @@ export const SettingsEditor = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Form {...form}>
|
<Form {...form}>
|
||||||
<div className='grid w-full max-w-6xl gap-2 mx-auto'>
|
|
||||||
<h1 className='text-2xl font-semibold md:text-3xl'>
|
|
||||||
<Trans i18nKey='settings.edit.title' />
|
|
||||||
</h1>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<form onSubmit={handleSubmit(onSubmit)}>
|
<form onSubmit={handleSubmit(onSubmit)}>
|
||||||
<div className='mx-auto grid w-full max-w-6xl items-start gap-6 md:grid-cols-[180px_1fr] lg:grid-cols-[250px_1fr]'>
|
<div className='mx-auto grid w-full max-w-6xl items-start gap-6 md:grid-cols-[180px_1fr] lg:grid-cols-[250px_1fr]'>
|
||||||
{form.formState.errors.root?.message && (
|
{form.formState.errors.root?.message && (
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import { Layout, LayoutContent, LayoutHeader } from "@/components";
|
import { Layout, LayoutContent, LayoutHeader } from "@/components";
|
||||||
import { PropsWithChildren } from "react";
|
import { PropsWithChildren } from "react";
|
||||||
|
import { Trans } from "react-i18next";
|
||||||
import { SettingsProvider } from "./SettingsContext";
|
import { SettingsProvider } from "./SettingsContext";
|
||||||
|
|
||||||
export const SettingsLayout = ({ children }: PropsWithChildren) => {
|
export const SettingsLayout = ({ children }: PropsWithChildren) => {
|
||||||
@ -7,7 +8,14 @@ export const SettingsLayout = ({ children }: PropsWithChildren) => {
|
|||||||
<SettingsProvider>
|
<SettingsProvider>
|
||||||
<Layout>
|
<Layout>
|
||||||
<LayoutHeader />
|
<LayoutHeader />
|
||||||
<LayoutContent>{children}</LayoutContent>
|
<LayoutContent>
|
||||||
|
<div className='grid w-full max-w-6xl gap-2 mx-auto'>
|
||||||
|
<h1 className='text-2xl font-semibold md:text-3xl'>
|
||||||
|
<Trans i18nKey='settings.edit.title' />
|
||||||
|
</h1>
|
||||||
|
</div>
|
||||||
|
{children}
|
||||||
|
</LayoutContent>
|
||||||
</Layout>
|
</Layout>
|
||||||
</SettingsProvider>
|
</SettingsProvider>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -1,41 +1,70 @@
|
|||||||
import { Button, Sheet, SheetContent, SheetTrigger } from "@/ui";
|
import { Button, Sheet, SheetContent, SheetTrigger } from "@/ui";
|
||||||
|
|
||||||
|
import { cn } from "@/lib/utils";
|
||||||
import { MenuIcon, Package2Icon } from "lucide-react";
|
import { MenuIcon, Package2Icon } from "lucide-react";
|
||||||
|
import { useCallback } from "react";
|
||||||
import { Trans } from "react-i18next";
|
import { Trans } from "react-i18next";
|
||||||
import { Link } from "react-router-dom";
|
import { Link, useLocation } from "react-router-dom";
|
||||||
import { UeckoLogo } from "../UeckoLogo";
|
import { UeckoLogo } from "../UeckoLogo";
|
||||||
import { UserButton } from "./components";
|
import { UserButton } from "./components";
|
||||||
|
|
||||||
export const LayoutHeader = () => {
|
export const LayoutHeader = () => {
|
||||||
|
const location = useLocation();
|
||||||
|
|
||||||
|
const isActiveLink = useCallback(
|
||||||
|
(path: string) => location.pathname === path,
|
||||||
|
[location.pathname]
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<header className='sticky top-0 z-10 flex items-center h-16 gap-8 px-4 border-b bg-accent md:px-6'>
|
<header className='sticky top-0 z-20 flex items-center h-16 gap-8 px-4 border-b shadow bg-accent md:px-6'>
|
||||||
<nav className='flex-col hidden gap-6 text-lg font-medium md:flex md:flex-row md:items-center md:gap-5 md:text-sm lg:gap-6'>
|
<nav className='flex-col hidden gap-6 text-lg font-medium md:flex md:flex-row md:items-center md:gap-5 md:text-sm lg:gap-6'>
|
||||||
<Link to='/' className='flex items-center font-semibold'>
|
<Link to='/' className='flex items-center font-semibold'>
|
||||||
<UeckoLogo className='w-24' />
|
<UeckoLogo className='w-24' />
|
||||||
<span className='sr-only'>Uecko</span>
|
<span className='sr-only'>Uecko</span>
|
||||||
</Link>
|
</Link>
|
||||||
<Link to='/home' className='transition-colors text-muted-foreground hover:text-foreground'>
|
<Link
|
||||||
|
to='/home'
|
||||||
|
className={cn(
|
||||||
|
"transition-colors text-muted-foreground hover:text-foreground",
|
||||||
|
isActiveLink("/home") ? "text-foreground" : "text-muted-foreground"
|
||||||
|
)}
|
||||||
|
>
|
||||||
<Trans i18nKey='main_menu.home' />
|
<Trans i18nKey='main_menu.home' />
|
||||||
</Link>
|
</Link>
|
||||||
<Link
|
<Link
|
||||||
to='/quotes'
|
to='/quotes'
|
||||||
className='transition-colors text-muted-foreground hover:text-foreground'
|
className={cn(
|
||||||
|
"transition-colors text-muted-foreground hover:text-foreground",
|
||||||
|
isActiveLink("/quotes") ? "text-foreground" : "text-muted-foreground"
|
||||||
|
)}
|
||||||
>
|
>
|
||||||
<Trans i18nKey='main_menu.quotes' />
|
<Trans i18nKey='main_menu.quotes' />
|
||||||
</Link>
|
</Link>
|
||||||
<Link
|
<Link
|
||||||
to='/catalog'
|
to='/catalog'
|
||||||
className='transition-colors text-muted-foreground hover:text-foreground'
|
className={cn(
|
||||||
|
"transition-colors text-muted-foreground hover:text-foreground",
|
||||||
|
isActiveLink("/catalog") ? "text-foreground" : "text-muted-foreground"
|
||||||
|
)}
|
||||||
>
|
>
|
||||||
<Trans i18nKey='main_menu.catalog' />
|
<Trans i18nKey='main_menu.catalog' />
|
||||||
</Link>
|
</Link>
|
||||||
<Link
|
{/*<Link
|
||||||
to='/dealers'
|
to='/dealers'
|
||||||
className='transition-colors text-muted-foreground hover:text-foreground'
|
className={cn(
|
||||||
>
|
"transition-colors text-muted-foreground hover:text-foreground",
|
||||||
|
isActiveLink("/dealers") ? "text-foreground" : "text-muted-foreground"
|
||||||
|
)}
|
||||||
<Trans i18nKey='main_menu.dealers' />
|
<Trans i18nKey='main_menu.dealers' />
|
||||||
</Link>
|
</Link>*/}
|
||||||
<Link to='/settings' className='transition-colors text-foreground hover:text-foreground'>
|
<Link
|
||||||
|
to='/settings'
|
||||||
|
className={cn(
|
||||||
|
"transition-colors text-muted-foreground hover:text-foreground",
|
||||||
|
isActiveLink("/settings") ? "text-foreground" : "text-muted-foreground"
|
||||||
|
)}
|
||||||
|
>
|
||||||
<Trans i18nKey='main_menu.settings' />
|
<Trans i18nKey='main_menu.settings' />
|
||||||
</Link>
|
</Link>
|
||||||
</nav>
|
</nav>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user