diff --git a/components.json b/components.json index ffd5afa..7bfb5bc 100644 --- a/components.json +++ b/components.json @@ -1,22 +1,22 @@ { - "$schema": "https://ui.shadcn.com/schema.json", - "style": "new-york", - "rsc": false, - "tsx": true, - "tailwind": { - "config": "", - "css": "src/App.css", - "baseColor": "neutral", - "cssVariables": true, - "prefix": "" - }, - "iconLibrary": "lucide", - "aliases": { - "components": "@/components", - "utils": "@/lib/utils", - "ui": "@/components/ui", - "lib": "@/lib", - "hooks": "@/hooks" - }, - "registries": {} + "$schema": "https://ui.shadcn.com/schema.json", + "style": "new-york", + "rsc": false, + "tsx": true, + "tailwind": { + "config": "", + "css": "src/App.css", + "baseColor": "neutral", + "cssVariables": true, + "prefix": "" + }, + "iconLibrary": "lucide", + "aliases": { + "components": "@/components", + "utils": "@/lib/utils", + "ui": "@/components/ui", + "lib": "@/lib", + "hooks": "@/hooks" + }, + "registries": {} } diff --git a/src/App.tsx b/src/App.tsx index ce92e6d..be61dd5 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,5 +1,5 @@ -import { BrowserRouter, Route, Routes } from "react-router-dom"; import Index from "@/Index"; +import { BrowserRouter, Route, Routes } from "react-router-dom"; import Settings from "./Settings"; function App() { diff --git a/src/Layout.tsx b/src/Layout.tsx index 5fad579..29dfc8c 100644 --- a/src/Layout.tsx +++ b/src/Layout.tsx @@ -1,7 +1,7 @@ import ThemeToggle from "@/components/theme-toggle"; -import { Link, useLocation } from "react-router-dom"; -import { Home, Settings } from "lucide-react"; import { Button } from "@/components/ui/button"; +import { Home, Settings } from "lucide-react"; +import { Link, useLocation } from "react-router-dom"; export default function Layout({ children, diff --git a/src/components/canvas/ShapeCanvas.tsx b/src/components/canvas/ShapeCanvas.tsx index 482dc89..7564943 100644 --- a/src/components/canvas/ShapeCanvas.tsx +++ b/src/components/canvas/ShapeCanvas.tsx @@ -1,7 +1,7 @@ -import { Stage, Layer } from "react-konva"; -import { useEffect, useState } from "react"; -import MorphableShape from "./MorphableShape"; import type { ShapeState } from "@/types/shape"; +import { useEffect, useState } from "react"; +import { Layer, Stage } from "react-konva"; +import MorphableShape from "./MorphableShape"; export default function ShapeCanvas({ state, diff --git a/src/components/theme-toggle.tsx b/src/components/theme-toggle.tsx index 5e6427b..ab2edad 100644 --- a/src/components/theme-toggle.tsx +++ b/src/components/theme-toggle.tsx @@ -1,7 +1,7 @@ -import { Moon, Sun } from "lucide-react"; -import { useEffect, useState } from "react"; import { Button } from "@/components/ui/button"; import { cn } from "@/lib/utils"; +import { Moon, Sun } from "lucide-react"; +import { useEffect, useState } from "react"; function ThemeToggle({ className }: { className?: string }) { const [theme, setTheme] = useState(); diff --git a/src/components/ui/button.tsx b/src/components/ui/button.tsx index a881f32..92ebff2 100644 --- a/src/components/ui/button.tsx +++ b/src/components/ui/button.tsx @@ -1,6 +1,6 @@ -import type * as React from "react"; import { Slot } from "@radix-ui/react-slot"; -import { cva, type VariantProps } from "class-variance-authority"; +import { type VariantProps, cva } from "class-variance-authority"; +import type * as React from "react"; import { cn } from "@/lib/utils"; diff --git a/src/components/ui/slider.tsx b/src/components/ui/slider.tsx index 0478ae0..c7ce352 100644 --- a/src/components/ui/slider.tsx +++ b/src/components/ui/slider.tsx @@ -1,5 +1,5 @@ -import * as React from "react"; import * as SliderPrimitive from "@radix-ui/react-slider"; +import * as React from "react"; import { cn } from "@/lib/utils"; diff --git a/src/components/ui/toggle.tsx b/src/components/ui/toggle.tsx index 3dd50f2..ca70a62 100644 --- a/src/components/ui/toggle.tsx +++ b/src/components/ui/toggle.tsx @@ -1,8 +1,8 @@ "use client"; -import type * as React from "react"; import * as TogglePrimitive from "@radix-ui/react-toggle"; -import { cva, type VariantProps } from "class-variance-authority"; +import { type VariantProps, cva } from "class-variance-authority"; +import type * as React from "react"; import { cn } from "@/lib/utils"; diff --git a/src/hooks/useShapeState.ts b/src/hooks/useShapeState.ts index c918a8e..cfb2031 100644 --- a/src/hooks/useShapeState.ts +++ b/src/hooks/useShapeState.ts @@ -39,17 +39,17 @@ export function useShapeState(centerX: number, centerY: number) { }, [centerX, centerY]); // beforeunload warning - useEffect(() => { - const handleBeforeUnload = (e: BeforeUnloadEvent) => { - const hasChanged = JSON.stringify(state) !== JSON.stringify(initialStateRef.current); - if (hasChanged) { - e.preventDefault(); - } - }; + // useEffect(() => { + // const handleBeforeUnload = (e: BeforeUnloadEvent) => { + // const hasChanged = JSON.stringify(state) !== JSON.stringify(initialStateRef.current); + // if (hasChanged) { + // e.preventDefault(); + // } + // }; - window.addEventListener("beforeunload", handleBeforeUnload); - return () => window.removeEventListener("beforeunload", handleBeforeUnload); - }, [state]); + // window.addEventListener("beforeunload", handleBeforeUnload); + // return () => window.removeEventListener("beforeunload", handleBeforeUnload); + // }, [state]); return [state, setState] as const; } diff --git a/src/lib/utils.ts b/src/lib/utils.ts index bd0c391..e644794 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -1,6 +1,6 @@ -import { clsx, type ClassValue } from "clsx" -import { twMerge } from "tailwind-merge" +import { type ClassValue, clsx } from "clsx"; +import { twMerge } from "tailwind-merge"; export function cn(...inputs: ClassValue[]) { - return twMerge(clsx(inputs)) + return twMerge(clsx(inputs)); } diff --git a/src/main.tsx b/src/main.tsx index 9a34bcb..a91e666 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -1,7 +1,7 @@ import "./App.css"; +import App from "@/App"; import React from "react"; import ReactDOM from "react-dom/client"; -import App from "@/App"; ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(