Skip to content

Commit cc25e7b

Browse files
committed
feat: Update new styles for shapes, improved enhancement
1 parent 07635cc commit cc25e7b

File tree

6 files changed

+15
-736
lines changed

6 files changed

+15
-736
lines changed

apps/collabydraw/components/AppSidebar.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {
2323
import { Button, buttonVariants } from "@/components/ui/button"
2424
import { Separator } from "@/components/ui/separator"
2525
import { ColorPicker } from "@/components/color-picker"
26-
import { ConfirmDialog } from "./confirm-dialog"
26+
import { ClearCanvasDialog } from "./clear-canvas-dialog"
2727
import { cn } from "@/lib/utils"
2828
import { useTheme } from "next-themes"
2929
import { signOut, useSession } from "next-auth/react"
@@ -84,16 +84,16 @@ export function AppSidebar({ isOpen, onClose, canvasColor, setCanvasColor, isMob
8484

8585
return (
8686
<>
87-
<ConfirmDialog
87+
<ClearCanvasDialog
8888
open={clearDialogOpen}
8989
onOpenChange={setClearDialogOpen}
9090
title="Clear canvas"
9191
description="This will clear the whole canvas. Are you sure?"
92-
onClearCanvas={isStandalone ? onClearCanvas : undefined}
92+
onClearCanvas={onClearCanvas ? onClearCanvas : () => { }}
9393
variant="destructive"
9494
/>
9595
<section data-sidebar className={cn("transition-transform duration-300 ease-in-out z-20", isMobile ? "" : "absolute top-full mt-2")}>
96-
<div className={cn("flex flex-col", isMobile ? "" : "h-[calc(100vh-150px)] Island rounded-lg")}>
96+
<div className={cn("flex flex-col", isMobile ? "" : "h-[calc(100vh-135px)] Island rounded-lg")}>
9797
<div className={cn("py-1", isMobile ? "" : "flex-1 overflow-auto py-1 custom-scrollbar")}>
9898
<nav className={cn("grid gap-1", isMobile ? "px-0" : "px-2")}>
9999
<SidebarItem icon={Command} label="Command palette" shortcut="Ctrl+/" />

apps/collabydraw/components/StyleConfigurator.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export function StyleConfigurator({
5757
}
5858
return (
5959
<>
60-
<section className={cn("StyleConfigurator p-3 overflow-auto custom-scrollbar transition-transform duration-300 ease-in-out z-10 mt-2",
60+
<section className={cn("StyleConfigurator p-3 overflow-y-auto overflow-x-hidden custom-scrollbar transition-transform duration-300 ease-in-out z-10 mt-2",
6161
isMobile ? "" : "absolute top-full w-56 h-[calc(100vh-150px)] bg-background dark:bg-w-bg rounded-lg Island"
6262
)}>
6363
<h2 className="sr-only">Selected shape actions</h2>

apps/collabydraw/components/canvas/CanvasRoot.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,10 @@ export default function CanvasRoot() {
226226
}
227227
}, [handleKeyDown, initializeCanvasEngine, isCanvasReady, isConnected, mode, canvasEngineState.engine]);
228228

229+
const clearCanvas = useCallback(() => {
230+
canvasEngineState.engine?.clearAllShapes();
231+
}, [canvasEngineState.engine]);
232+
229233
const toggleSidebar = useCallback(() => {
230234
setCanvasEngineState(prev => ({ ...prev, sidebarOpen: !prev.sidebarOpen }));
231235
}, []);
@@ -256,6 +260,7 @@ export default function CanvasRoot() {
256260
setCanvasEngineState(prev => ({ ...prev, canvasColor: typeof newCanvasColor === 'function' ? newCanvasColor(prev.canvasColor) : newCanvasColor }))
257261
}
258262
isStandalone={mode === 'room' ? false : true}
263+
onClearCanvas={clearCanvas}
259264
/>
260265
)}
261266
</div>

apps/collabydraw/components/canvas/CanvasSheet.tsx

Lines changed: 0 additions & 290 deletions
This file was deleted.

0 commit comments

Comments
 (0)