From 2dbdd18483a6cfbda7c965e8f7b4df89d39d5432 Mon Sep 17 00:00:00 2001 From: David Hill Date: Mon, 19 Jan 2026 17:01:56 +0000 Subject: [PATCH] add hover overlay with upload/trash icons to project icon in edit dialog --- .../src/components/dialog-edit-project.tsx | 65 +++++++++++++++---- packages/ui/src/components/icon.tsx | 2 + 2 files changed, 54 insertions(+), 13 deletions(-) diff --git a/packages/app/src/components/dialog-edit-project.tsx b/packages/app/src/components/dialog-edit-project.tsx index f6e07df60..091f00702 100644 --- a/packages/app/src/components/dialog-edit-project.tsx +++ b/packages/app/src/components/dialog-edit-project.tsx @@ -27,11 +27,15 @@ export function DialogEditProject(props: { project: LocalProject }) { }) const [dragOver, setDragOver] = createSignal(false) + const [iconHover, setIconHover] = createSignal(false) function handleFileSelect(file: File) { if (!file.type.startsWith("image/")) return const reader = new FileReader() - reader.onload = (e) => setStore("iconUrl", e.target?.result as string) + reader.onload = (e) => { + setStore("iconUrl", e.target?.result as string) + setIconHover(false) + } reader.readAsDataURL(file) } @@ -92,9 +96,9 @@ export function DialogEditProject(props: { project: LocalProject }) {
-
+
setIconHover(true)} onMouseLeave={() => setIconHover(false)}>
document.getElementById("icon-upload")?.click()} + onClick={() => { + if (store.iconUrl && iconHover()) { + clearIcon() + } else { + document.getElementById("icon-upload")?.click() + } + }} >
- - - +
+ +
+
+ +
diff --git a/packages/ui/src/components/icon.tsx b/packages/ui/src/components/icon.tsx index 2d680b28b..98f96c8e8 100644 --- a/packages/ui/src/components/icon.tsx +++ b/packages/ui/src/components/icon.tsx @@ -64,6 +64,8 @@ const icons = { help: ``, "settings-gear": ``, dash: ``, + "cloud-upload": ``, + trash: ``, } export interface IconProps extends ComponentProps<"svg"> {