From 6880811236b12fbfcb3e5d0ef97ea60d07afa5d8 Mon Sep 17 00:00:00 2001 From: John Costa Date: Sun, 5 Oct 2025 15:54:46 +0100 Subject: [PATCH] fix: delete schema column button --- frontend/src/pages/image/index.tsx | 2 +- frontend/src/pages/stack/index.tsx | 101 +++++++++++++++++++++++------ 2 files changed, 82 insertions(+), 21 deletions(-) diff --git a/frontend/src/pages/image/index.tsx b/frontend/src/pages/image/index.tsx index eb75493..babdf95 100644 --- a/frontend/src/pages/image/index.tsx +++ b/frontend/src/pages/image/index.tsx @@ -22,7 +22,7 @@ export const ImagePage: Component = () => { }} />
-

Description

+

Stacks

{(imageList) => ( diff --git a/frontend/src/pages/stack/index.tsx b/frontend/src/pages/stack/index.tsx index 82598a9..4a48db6 100644 --- a/frontend/src/pages/stack/index.tsx +++ b/frontend/src/pages/stack/index.tsx @@ -1,4 +1,3 @@ -import { useSearchImageContext } from "@contexts/SearchImageContext"; import { useParams, useNavigate } from "@solidjs/router"; import { Component, @@ -10,6 +9,7 @@ import { } from "solid-js"; import { base, getAccessToken } from "../../network"; import { Dialog } from "@kobalte/core"; +import { useSearchImageContext } from "@contexts/SearchImageContext"; const DeleteButton: Component<{ onDelete: () => void }> = (props) => { const [isOpen, setIsOpen] = createSignal(false); @@ -103,11 +103,58 @@ const DeleteStackButton: Component<{ onDelete: () => void }> = (props) => { ); }; +const DeleteStackItemButton: Component<{ onDelete: () => void }> = (props) => { + const [isOpen, setIsOpen] = createSignal(false); + + return ( + <> + + + + + +
+ + + Confirm Delete + + + Are you sure you want to delete this column from + this list? + +
+ + + + +
+
+
+
+
+ + ); +}; + export const Stack: Component = () => { const { stackID } = useParams(); const nav = useNavigate(); - const { stacks, onDeleteImageFromStack, onDeleteStack } = useSearchImageContext(); + const { stacks, onDeleteImageFromStack, onDeleteStack, onDeleteStackItem } = + useSearchImageContext(); const [accessToken] = createResource(getAccessToken); @@ -135,7 +182,9 @@ export const Stack: Component = () => {

- +
{ {(item, index) => ( - {item.Item} +
+ {item.Item} + + onDeleteStackItem( + s().ID, + item.ID, + ) + } + /> +
)}
@@ -169,10 +228,11 @@ export const Stack: Component = () => { {(image, rowIndex) => (
@@ -199,13 +259,14 @@ export const Stack: Component = () => { {(item, colIndex) => (