From 10326e0d5ca350bed6648f969b2b17e76827974f Mon Sep 17 00:00:00 2001 From: Artur AGH Date: Mon, 18 Dec 2023 12:06:02 +0100 Subject: [PATCH] layout changes --- .../Test/content/edit-utils/sidebar.tsx | 10 ---- .../Test/content/edit-utils/stage-mode.tsx | 40 -------------- .../content/playground-area/stage-area.tsx | 25 --------- src/components/Test/content/playground.tsx | 21 ------- .../Navbar.tsx => layout/header/Header.tsx} | 10 ++-- .../navbar => layout/header}/Preview.tsx | 2 +- .../{Test/navbar => layout/header}/Save.tsx | 0 .../header}/list-de-vignerons.ts | 0 .../header}/select-vigneron.tsx | 6 +- src/components/layout/layout.tsx | 55 +++++++++++-------- src/components/layout/sidebar/layers.tsx | 1 - src/components/ui/button.tsx | 28 +++++----- 12 files changed, 54 insertions(+), 144 deletions(-) delete mode 100644 src/components/Test/content/edit-utils/sidebar.tsx delete mode 100644 src/components/Test/content/edit-utils/stage-mode.tsx delete mode 100644 src/components/Test/content/playground-area/stage-area.tsx delete mode 100644 src/components/Test/content/playground.tsx rename src/components/{Test/navbar/Navbar.tsx => layout/header/Header.tsx} (65%) rename src/components/{Test/navbar => layout/header}/Preview.tsx (100%) rename src/components/{Test/navbar => layout/header}/Save.tsx (100%) rename src/components/{Test/navbar => layout/header}/list-de-vignerons.ts (100%) rename src/components/{Test/navbar => layout/header}/select-vigneron.tsx (99%) diff --git a/src/components/Test/content/edit-utils/sidebar.tsx b/src/components/Test/content/edit-utils/sidebar.tsx deleted file mode 100644 index 68c086f..0000000 --- a/src/components/Test/content/edit-utils/sidebar.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import React from "react"; -import StageMode from "@/components/Test/content/edit-utils/stage-mode"; - -export default function Sidebar() { - return ( - <> - - - ); -} diff --git a/src/components/Test/content/edit-utils/stage-mode.tsx b/src/components/Test/content/edit-utils/stage-mode.tsx deleted file mode 100644 index 522f474..0000000 --- a/src/components/Test/content/edit-utils/stage-mode.tsx +++ /dev/null @@ -1,40 +0,0 @@ -import React from "react"; -import { - HoverCard, - HoverCardContent, - HoverCardTrigger, -} from "@/components/ui/hover-card"; -import { TabsList, TabsTrigger } from "@/components/ui/tabs"; -import { PiBeerBottle } from "react-icons/pi"; - -export default function StageMode() { - return ( -
- - - - Taille de l'etquieutte - - - - Sélectionnez la taille de votre raquette parmi les trois tailles - disponibles : S, M, L. - - - - - Complete - - - - Insert - - - - Edit - - - -
- ); -} diff --git a/src/components/Test/content/playground-area/stage-area.tsx b/src/components/Test/content/playground-area/stage-area.tsx deleted file mode 100644 index 361fd94..0000000 --- a/src/components/Test/content/playground-area/stage-area.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import React from "react"; -import { TabsContent } from "@/components/ui/tabs"; -import { Button } from "@/components/ui/button"; -import { CounterClockwiseClockIcon } from "@radix-ui/react-icons"; -import Canvas from "@/components/canvas"; - -export default function StageArea() { - return ( - -
-
- -
- -
- - -
-
-
- ); -} diff --git a/src/components/Test/content/playground.tsx b/src/components/Test/content/playground.tsx deleted file mode 100644 index 4ee528c..0000000 --- a/src/components/Test/content/playground.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import React from "react"; -import { Tabs } from "@/components/ui/tabs"; -import Sidebar from "@/components/Test/content/edit-utils/sidebar"; -import StageArea from "@/components/Test/content/playground-area/stage-area"; - -export default function Playground() { - return ( - -
-
-
- -
-
- -
-
-
-
- ); -} diff --git a/src/components/Test/navbar/Navbar.tsx b/src/components/layout/header/Header.tsx similarity index 65% rename from src/components/Test/navbar/Navbar.tsx rename to src/components/layout/header/Header.tsx index c9eb8de..d2f3179 100644 --- a/src/components/Test/navbar/Navbar.tsx +++ b/src/components/layout/header/Header.tsx @@ -1,11 +1,11 @@ import React from "react"; -import { Save } from "@/components/Test/navbar/Save"; -import { Preview } from "@/components/Test/navbar/Preview"; -import { SelectVigneron } from "@/components/Test/navbar/select-vigneron"; -import { presets } from "@/components/Test/navbar/list-de-vignerons"; +import { Save } from "@/components/layout/header/Save"; +import { Preview } from "@/components/layout/header/Preview"; +import { SelectVigneron } from "@/components/layout/header/select-vigneron"; +import { presets } from "@/components/layout/header/list-de-vignerons"; import { UserNav } from "@/components/layout/user-nav"; -export default function Navbar() { +export default function Header() { return (

Vitiquette

diff --git a/src/components/Test/navbar/Preview.tsx b/src/components/layout/header/Preview.tsx similarity index 100% rename from src/components/Test/navbar/Preview.tsx rename to src/components/layout/header/Preview.tsx index 885d8bf..1789b3e 100644 --- a/src/components/Test/navbar/Preview.tsx +++ b/src/components/layout/header/Preview.tsx @@ -1,4 +1,3 @@ -import { Button } from "@/components/ui/button"; import { Dialog, DialogContent, @@ -7,6 +6,7 @@ import { DialogTitle, DialogTrigger, } from "@/components/ui/dialog"; +import { Button } from "@/components/ui/button"; export function Preview() { return ( diff --git a/src/components/Test/navbar/Save.tsx b/src/components/layout/header/Save.tsx similarity index 100% rename from src/components/Test/navbar/Save.tsx rename to src/components/layout/header/Save.tsx diff --git a/src/components/Test/navbar/list-de-vignerons.ts b/src/components/layout/header/list-de-vignerons.ts similarity index 100% rename from src/components/Test/navbar/list-de-vignerons.ts rename to src/components/layout/header/list-de-vignerons.ts diff --git a/src/components/Test/navbar/select-vigneron.tsx b/src/components/layout/header/select-vigneron.tsx similarity index 99% rename from src/components/Test/navbar/select-vigneron.tsx rename to src/components/layout/header/select-vigneron.tsx index e07b158..c96b12c 100644 --- a/src/components/Test/navbar/select-vigneron.tsx +++ b/src/components/layout/header/select-vigneron.tsx @@ -4,9 +4,6 @@ import * as React from "react"; import { useRouter } from "next/navigation"; import { CaretSortIcon, CheckIcon } from "@radix-ui/react-icons"; import { type PopoverProps } from "@radix-ui/react-popover"; - -import { cn } from "@/lib/utils"; -import { Button } from "@/components/ui/button"; import { Command, CommandEmpty, @@ -19,8 +16,9 @@ import { PopoverContent, PopoverTrigger, } from "@/components/ui/popover"; - import { type Preset } from "./list-de-vignerons"; +import { Button } from "@/components/ui/button"; +import { cn } from "@/lib/utils"; interface PresetSelectorProps extends PopoverProps { presets: Preset[]; diff --git a/src/components/layout/layout.tsx b/src/components/layout/layout.tsx index d869839..5763b00 100644 --- a/src/components/layout/layout.tsx +++ b/src/components/layout/layout.tsx @@ -1,9 +1,9 @@ import type { ReactNode } from "react"; import React from "react"; +import { Sidebar } from "@/components/layout/sidebar/sidebar"; +import Header from "@/components/layout/header/Header"; import { Separator } from "@/components/ui/separator"; import { Tabs } from "@/components/ui/tabs"; -import { Sidebar } from "@/components/layout/sidebar/sidebar"; -import { Navbar } from "@/components/layout/navbar"; type Props = { children: ReactNode; @@ -11,29 +11,38 @@ type Props = { export const Layout = ({ children }: Props) => { return ( -
- -
- -
{children}
-
+
+
+ - {/*Test Update Version */} - - {/*
- - - -
-
-
{children}
-
- -
-
+
+
+
{children}
+
+
- -
*/} +
+
); }; + +/*
+
+ + +
+
+
{children}
+
+ +
+
+
+
+ +
+ +
{children}
+
+
;*/ diff --git a/src/components/layout/sidebar/layers.tsx b/src/components/layout/sidebar/layers.tsx index ef8d6c5..1bad938 100644 --- a/src/components/layout/sidebar/layers.tsx +++ b/src/components/layout/sidebar/layers.tsx @@ -19,7 +19,6 @@ import LayerItem from "@/components/layer-item"; export const Layers = () => { const dispatch = useAppDispatch(); - const currentStep = useAppSelector((state) => state.app.currentStep); const items = useAppSelector( (state) => state.app.history[currentStep]?.items, diff --git a/src/components/ui/button.tsx b/src/components/ui/button.tsx index 275cd27..0ba4277 100644 --- a/src/components/ui/button.tsx +++ b/src/components/ui/button.tsx @@ -1,11 +1,11 @@ -import * as React from "react"; -import { cva, type VariantProps } from "class-variance-authority"; +import * as React from "react" +import { Slot } from "@radix-ui/react-slot" +import { cva, type VariantProps } from "class-variance-authority" -import { cn } from "@/lib/utils"; -import { Slot } from "@radix-ui/themes"; +import { cn } from "@/lib/utils" const buttonVariants = cva( - "inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", + "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", { variants: { variant: { @@ -30,27 +30,27 @@ const buttonVariants = cva( variant: "default", size: "default", }, - }, -); + } +) export interface ButtonProps extends React.ButtonHTMLAttributes, VariantProps { - asChild?: boolean; + asChild?: boolean } const Button = React.forwardRef( ({ className, variant, size, asChild = false, ...props }, ref) => { - const Comp = asChild ? Slot : "button"; + const Comp = asChild ? Slot : "button" return ( - ); - }, -); -Button.displayName = "Button"; + ) + } +) +Button.displayName = "Button" -export { Button, buttonVariants }; +export { Button, buttonVariants }