diff --git a/.vscode/launch.json b/.vscode/launch.json index f777ab6..acdce32 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,7 +1,4 @@ { - // Pro informace o možných atributech použijte technologii IntelliSense. - // Umístěním ukazatele myši zobrazíte popisy existujících atributů. - // Další informace najdete tady: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { @@ -20,7 +17,7 @@ "justMyCode": true }, { - "name": "Frontend", + "name": "Frontend: Dev", "type": "node", "request": "launch", "cwd": "${workspaceFolder}/frontend", @@ -33,5 +30,29 @@ "/**" ], } + , + { + "name": "Frontend: Prod", + "type": "node", + "request": "launch", + "cwd": "${workspaceFolder}/frontend", + "runtimeArgs": [ + "run", + "preview" + ], + "runtimeExecutable": "npm", + "skipFiles": [ + "/**" + ], + } + ], + "compounds": [ + { + "name": "Full Stack Debug", + "configurations": [ + "Flask Shop", + "Frontend: Dev" + ] + } ] } \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..2e3dedf --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,14 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "type": "npm", + "script": "build", + "path": "frontend", + "group": "build", + "problemMatcher": [], + "label": "npm: build - frontend", + "detail": "tsc -b && vite build" + } + ] +} \ No newline at end of file diff --git a/frontend/package-lock.json b/frontend/package-lock.json index e98e793..5de3676 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -42,7 +42,7 @@ "js-cookie": "^3.0.5", "lucide-react": "^0.475.0", "react": "^19.0.0", - "react-day-picker": "^9.5.1", + "react-day-picker": "^8.10.1", "react-dom": "^19.0.0", "react-hook-form": "^7.54.0", "recharts": "^2.14.1", @@ -460,11 +460,6 @@ "node": ">=6.9.0" } }, - "node_modules/@date-fns/tz": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@date-fns/tz/-/tz-1.2.0.tgz", - "integrity": "sha512-LBrd7MiJZ9McsOgxqWX7AaxrDjcFVjWH/tIKJd7pnR7McaslGYOP1QmmiBXdJH/H/yLCT+rcQ7FaPBUxRGUtrg==" - }, "node_modules/@esbuild/aix-ppc64": { "version": "0.24.2", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.24.2.tgz", @@ -4099,11 +4094,6 @@ "url": "https://github.com/sponsors/kossnocorp" } }, - "node_modules/date-fns-jalali": { - "version": "4.1.0-0", - "resolved": "https://registry.npmjs.org/date-fns-jalali/-/date-fns-jalali-4.1.0-0.tgz", - "integrity": "sha512-hTIP/z+t+qKwBDcmmsnmjWTduxCg+5KfdqWQvb2X/8C9+knYY6epN/pfxdDuyVlSVeFz0sM5eEfwIUQ70U4ckg==" - }, "node_modules/debug": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", @@ -5959,23 +5949,16 @@ } }, "node_modules/react-day-picker": { - "version": "9.5.1", - "resolved": "https://registry.npmjs.org/react-day-picker/-/react-day-picker-9.5.1.tgz", - "integrity": "sha512-PxuK8inYLlYgM2zZUVBPsaBM5jI40suPeG+naKyx7kpyF032RRlEAUEjkpW9/poTASh/vyWAOVqjGuGw+47isw==", - "dependencies": { - "@date-fns/tz": "^1.2.0", - "date-fns": "^4.1.0", - "date-fns-jalali": "^4.1.0-0" - }, - "engines": { - "node": ">=18" - }, + "version": "8.10.1", + "resolved": "https://registry.npmjs.org/react-day-picker/-/react-day-picker-8.10.1.tgz", + "integrity": "sha512-TMx7fNbhLk15eqcMt+7Z7S2KF7mfTId/XJDjKE8f+IUcFn0l08/kI4FiYTL/0yuOLmEcbR4Fwe3GJf/NiiMnPA==", "funding": { "type": "individual", "url": "https://github.com/sponsors/gpbl" }, "peerDependencies": { - "react": ">=16.8.0" + "date-fns": "^2.28.0 || ^3.0.0", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" } }, "node_modules/react-dom": { diff --git a/frontend/package.json b/frontend/package.json index ca824eb..1a4df08 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -7,7 +7,10 @@ "dev": "vite", "build": "tsc -b && vite build", "lint": "eslint .", - "preview": "vite preview" + "preview": "vite preview", + "format:check": "prettier --check .", + "format": "prettier --write .", + "knip": "knip" }, "dependencies": { "@hookform/resolvers": "^3.9.1", @@ -44,7 +47,7 @@ "js-cookie": "^3.0.5", "lucide-react": "^0.475.0", "react": "^19.0.0", - "react-day-picker": "^9.5.1", + "react-day-picker": "^8.10.1", "react-dom": "^19.0.0", "react-hook-form": "^7.54.0", "recharts": "^2.14.1", diff --git a/frontend/src/components/main-navbar.tsx b/frontend/src/components/main-navbar.tsx index d0a8e23..f5b24f7 100644 --- a/frontend/src/components/main-navbar.tsx +++ b/frontend/src/components/main-navbar.tsx @@ -8,7 +8,6 @@ import { Menu } from "lucide-react"; import { Card } from "@/components/ui/card"; import { ThemeSwitch } from "./theme-switch"; import { Button } from "@/components/ui/button"; -import { nanoid } from "nanoid"; import { Link } from "@tanstack/react-router"; const MainNavbar = () => { @@ -74,52 +73,4 @@ const MainNavbar = () => { ); }; -const landings = [ - { - id: nanoid(), - title: "Landing 01", - route: "/project-management" - }, - { - id: nanoid(), - title: "Landing 02", - route: "/crm-landing" - }, - { - id: nanoid(), - title: "Landing 03", - route: "/ai-content-landing" - }, - { - id: nanoid(), - title: "Landing 04", - route: "/new-intro-landing" - }, - { - id: nanoid(), - title: "Landing 05", - route: "/about-us-landing" - }, - { - id: nanoid(), - title: "Landing 06", - route: "/contact-us-landing" - }, - { - id: nanoid(), - title: "Landing 07", - route: "/faqs-landing" - }, - { - id: nanoid(), - title: "Landing 08", - route: "/pricing-landing" - }, - { - id: nanoid(), - title: "Landing 09", - route: "/career-landing" - } -]; - export default MainNavbar; diff --git a/frontend/src/components/ui/button.tsx b/frontend/src/components/ui/button.tsx index a3b6588..6daa85a 100644 --- a/frontend/src/components/ui/button.tsx +++ b/frontend/src/components/ui/button.tsx @@ -1,29 +1,29 @@ 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"; const buttonVariants = cva( - "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", + "inline-flex items-center justify-center gap-2 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 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", { variants: { variant: { - default: - "bg-primary text-primary-foreground shadow hover:bg-primary/90", + default: "bg-primary text-primary-foreground hover:bg-primary/90", destructive: - "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90", + "bg-destructive text-destructive-foreground hover:bg-destructive/90", outline: - "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground", + "border border-input bg-background hover:bg-accent hover:text-accent-foreground", secondary: - "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80", + "bg-secondary text-secondary-foreground hover:bg-secondary/80", ghost: "hover:bg-accent hover:text-accent-foreground", link: "text-primary underline-offset-4 hover:underline" }, size: { - default: "h-9 px-4 py-2", - sm: "h-8 rounded-md px-3 text-xs", - lg: "h-10 rounded-md px-8", - icon: "h-9 w-9" + default: "h-10 px-4 py-2", + sm: "h-9 rounded-md px-3", + lg: "h-11 rounded-md px-8", + icon: "h-10 w-10" } }, defaultVariants: { diff --git a/frontend/src/components/ui/calendar.tsx b/frontend/src/components/ui/calendar.tsx index 0dbe66d..931d0ea 100644 --- a/frontend/src/components/ui/calendar.tsx +++ b/frontend/src/components/ui/calendar.tsx @@ -1,6 +1,7 @@ import * as React from "react"; import { ChevronLeft, ChevronRight } from "lucide-react"; import { DayPicker } from "react-day-picker"; + import { cn } from "@/lib/utils"; import { buttonVariants } from "@/components/ui/button"; @@ -31,19 +32,13 @@ function Calendar({ table: "w-full border-collapse space-y-1", head_row: "flex", head_cell: - "text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]", + "text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]", row: "flex w-full mt-2", - cell: cn( - "relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-r-md", - props.mode === "range" - ? "[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md" - : "[&:has([aria-selected])]:rounded-md" - ), + cell: "h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20", day: cn( buttonVariants({ variant: "ghost" }), - "h-8 w-8 p-0 font-normal aria-selected:opacity-100" + "h-9 w-9 p-0 font-normal aria-selected:opacity-100" ), - day_range_start: "day-range-start", day_range_end: "day-range-end", day_selected: "bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground", @@ -57,8 +52,12 @@ function Calendar({ ...classNames }} components={{ - IconLeft: () => , - IconRight: () => + IconLeft: ({ className, ...props }) => ( + + ), + IconRight: ({ className, ...props }) => ( + + ) }} {...props} /> diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index 0ae3dc5..9489ef3 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -13,4 +13,10 @@ export default defineConfig({ "@": path.resolve(__dirname, "./src"), }, }, + server: { + port: 31713 + }, + preview: { + port: 37173 + } })