From 52953db80eaa32006c8cf91a12dee2f464663f7a Mon Sep 17 00:00:00 2001 From: Malted Date: Wed, 13 Nov 2024 17:02:56 -0500 Subject: [PATCH 1/3] Confirm ship deletion --- src/app/harbor/shipyard/edit-ship-form.tsx | 26 ++++++++++++++++++++-- src/components/ui/button.tsx | 2 +- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/app/harbor/shipyard/edit-ship-form.tsx b/src/app/harbor/shipyard/edit-ship-form.tsx index 246a563d..120caa68 100644 --- a/src/app/harbor/shipyard/edit-ship-form.tsx +++ b/src/app/harbor/shipyard/edit-ship-form.tsx @@ -3,7 +3,8 @@ import { deleteShip, updateShip } from './ship-utils' import type { Ship } from '@/app/utils/data' import { useToast } from '@/hooks/use-toast' import Icon from '@hackclub/icons' -import { useState } from 'react' +import React, { useState } from 'react' +import Modal from '../../../components/ui/modal' const editMessages = [ 'Orpheus hopes you know that she put a lot of effort into recording your changes~', @@ -27,6 +28,7 @@ export default function EditShipForm({ setShips: any }) { const [deleting, setDeleting] = useState(false) + const [openDeleteModal, setOpenDeleteModal] = useState(false) const [saving, setSaving] = useState(false) const allowDeletion = ship.shipStatus === 'staged' @@ -194,7 +196,10 @@ export default function EditShipForm({ {allowDeletion && ( )} + + setOpenDeleteModal(false)}> +
+

+ Are you sure you want to delete {ship.title}? +

+
+ + +
+
+
) } diff --git a/src/components/ui/button.tsx b/src/components/ui/button.tsx index 34bd6fc8..a566093d 100644 --- a/src/components/ui/button.tsx +++ b/src/components/ui/button.tsx @@ -13,7 +13,7 @@ const buttonVariants = cva( destructive: 'bg-destructive text-destructive-foreground hover:bg-destructive/90', outline: - 'bg-[#ffffffaa] text-secondary-foreground border border-input bg-background hover:bg-accent hover:text-accent-foreground', + '!bg-transparent text-white border border-input bg-background hover:bg-accent hover:opacity-80', secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80', ghost: 'hover:bg-accent hover:text-accent-foreground', From 6085da64627f9235f38b94ee7bfddfb74712d97d Mon Sep 17 00:00:00 2001 From: Malted Date: Wed, 13 Nov 2024 17:05:51 -0500 Subject: [PATCH 2/3] Destructive variant --- src/app/harbor/shipyard/edit-ship-form.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/harbor/shipyard/edit-ship-form.tsx b/src/app/harbor/shipyard/edit-ship-form.tsx index 120caa68..1d43de48 100644 --- a/src/app/harbor/shipyard/edit-ship-form.tsx +++ b/src/app/harbor/shipyard/edit-ship-form.tsx @@ -220,7 +220,7 @@ export default function EditShipForm({ > NNONNO WAIT ヽ(O_O )ノ - + From b35048f655488ca97304365174a272b1da3e8861 Mon Sep 17 00:00:00 2001 From: Malted Date: Wed, 13 Nov 2024 17:16:14 -0500 Subject: [PATCH 3/3] Fix lint --- src/app/harbor/shipyard/edit-ship-form.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/app/harbor/shipyard/edit-ship-form.tsx b/src/app/harbor/shipyard/edit-ship-form.tsx index 1d43de48..2a2ac18c 100644 --- a/src/app/harbor/shipyard/edit-ship-form.tsx +++ b/src/app/harbor/shipyard/edit-ship-form.tsx @@ -220,7 +220,12 @@ export default function EditShipForm({ > NNONNO WAIT ヽ(O_O )ノ - +