From ba1d7c41c3dfb96af27c724952113972e692c79f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josip=20Crnkovi=C4=87?= <6536260+crnkovic@users.noreply.github.com> Date: Tue, 7 Nov 2023 14:08:34 +0100 Subject: [PATCH 01/10] wip --- .../Galleries/DeleteGalleryButton.tsx | 53 ++++++++++++++++++ .../Galleries/NftGalleryCard.blocks.tsx | 55 ++++++++++++++----- .../Components/Galleries/NftGalleryCard.tsx | 30 ++++++---- .../js/Pages/Galleries/MyGalleries/Index.tsx | 1 + 4 files changed, 114 insertions(+), 25 deletions(-) create mode 100644 resources/js/Components/Galleries/DeleteGalleryButton.tsx diff --git a/resources/js/Components/Galleries/DeleteGalleryButton.tsx b/resources/js/Components/Galleries/DeleteGalleryButton.tsx new file mode 100644 index 000000000..2a0c62946 --- /dev/null +++ b/resources/js/Components/Galleries/DeleteGalleryButton.tsx @@ -0,0 +1,53 @@ +import { useForm } from "@inertiajs/react"; +import { useState } from "react"; +import { useTranslation } from "react-i18next"; +import { Button } from "@/Components/Buttons"; +import { ConfirmDeletionDialog } from "@/Components/ConfirmDeletionDialog"; + +const DeleteGalleryButton = ({ gallery }: { gallery: App.Data.Gallery.GalleryData }): JSX.Element => { + const { t } = useTranslation(); + const [open, setOpen] = useState(false); + + const { processing, delete: remove } = useForm({}); + + const submit = (): void => { + remove( + route("my-galleries.destroy", { + slug: gallery.slug, + }), + { + onFinish: () => { + setOpen(false); + }, + }, + ); + }; + + return ( + <> +