refactor: move components into folders
This commit is contained in:
parent
1dbb126b90
commit
ceb87c2088
8 changed files with 15 additions and 8 deletions
|
|
@ -59,6 +59,10 @@ function Blocks({ blocks, setBlocks, textures, image, imageDimensions }: Props)
|
||||||
}
|
}
|
||||||
}, [image, imageDimensions, setBlocks]);
|
}, [image, imageDimensions, setBlocks]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
console.log(blocks);
|
||||||
|
}, [blocks]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{blocks.map((block, index) => {
|
{blocks.map((block, index) => {
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { useContext } from "react";
|
import { useContext } from "react";
|
||||||
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
|
import { EraserIcon, HandIcon, PencilIcon, ZoomInIcon } from "lucide-react";
|
||||||
import { Eraser, Hand, Pencil } from "lucide-react";
|
|
||||||
|
|
||||||
|
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
|
||||||
import { ToolContext } from "@/context/ToolContext";
|
import { ToolContext } from "@/context/ToolContext";
|
||||||
|
|
||||||
function Toolbar() {
|
function Toolbar() {
|
||||||
|
|
@ -17,13 +17,16 @@ function Toolbar() {
|
||||||
className="flex flex-col justify-start py-1 border-r border-zinc-200 dark:border-zinc-800 bg-white dark:bg-zinc-950"
|
className="flex flex-col justify-start py-1 border-r border-zinc-200 dark:border-zinc-800 bg-white dark:bg-zinc-950"
|
||||||
>
|
>
|
||||||
<ToggleGroupItem value="hand" className="!p-0 !h-8 !min-w-8">
|
<ToggleGroupItem value="hand" className="!p-0 !h-8 !min-w-8">
|
||||||
<Hand />
|
<HandIcon />
|
||||||
</ToggleGroupItem>
|
</ToggleGroupItem>
|
||||||
<ToggleGroupItem value="pencil" className="!p-0 !h-8 !min-w-8">
|
<ToggleGroupItem value="pencil" className="!p-0 !h-8 !min-w-8">
|
||||||
<Pencil />
|
<PencilIcon />
|
||||||
</ToggleGroupItem>
|
</ToggleGroupItem>
|
||||||
<ToggleGroupItem value="eraser" className="!p-0 !h-8 !min-w-8">
|
<ToggleGroupItem value="eraser" className="!p-0 !h-8 !min-w-8">
|
||||||
<Eraser />
|
<EraserIcon />
|
||||||
|
</ToggleGroupItem>
|
||||||
|
<ToggleGroupItem value="zoom" className="!p-0 !h-8 !min-w-8">
|
||||||
|
<ZoomInIcon />
|
||||||
</ToggleGroupItem>
|
</ToggleGroupItem>
|
||||||
</ToggleGroup>
|
</ToggleGroup>
|
||||||
);
|
);
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
import { ImageProvider } from "@/context/ImageContext";
|
import { ImageProvider } from "../context/ImageContext";
|
||||||
import { SettingsProvider } from "../context/SettingsContext";
|
import { SettingsProvider } from "../context/SettingsContext";
|
||||||
import { TexturesProvider } from "../context/TexturesContext";
|
import { TexturesProvider } from "../context/TexturesContext";
|
||||||
import { ToolProvider } from "../context/ToolContext";
|
import { ToolProvider } from "../context/ToolContext";
|
||||||
|
|
||||||
import Menubar from "../components/menubar";
|
import Menubar from "../components/menubar";
|
||||||
import Toolbar from "../components/Toolbar";
|
import Toolbar from "../components/toolbar";
|
||||||
import Canvas from "../components/Canvas";
|
import Canvas from "../components/canvas/Canvas";
|
||||||
|
|
||||||
function AppPage() {
|
function AppPage() {
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue