From 3c42fc44e182ff2b76b4ca3e2bedf5347dacb8e0 Mon Sep 17 00:00:00 2001 From: Brendan Quinn Date: Thu, 27 Jun 2024 20:52:43 +0000 Subject: [PATCH] Convert FileSetModel modal to a Dialog component --- .../Work/Tabs/Preservation/FileSetModal.jsx | 212 +++++++++--------- 1 file changed, 105 insertions(+), 107 deletions(-) diff --git a/app/assets/js/components/Work/Tabs/Preservation/FileSetModal.jsx b/app/assets/js/components/Work/Tabs/Preservation/FileSetModal.jsx index 7c2f138bd..b32049aba 100644 --- a/app/assets/js/components/Work/Tabs/Preservation/FileSetModal.jsx +++ b/app/assets/js/components/Work/Tabs/Preservation/FileSetModal.jsx @@ -1,4 +1,11 @@ -import { Button, Notification } from "@nulib/design-system"; +import * as Dialog from "@radix-ui/react-dialog"; +import { + DialogClose, + DialogContent, + DialogOverlay, + DialogTitle +} from "@js/components/UI/Dialog/Dialog.styled"; +import { Button, Icon, Notification } from "@nulib/design-system"; import { FormProvider, useForm } from "react-hook-form"; import { GET_WORK, INGEST_FILE_SET } from "@js/components/Work/work.gql.js"; import React, { useState } from "react"; @@ -14,15 +21,10 @@ import UIFormField from "@js/components/UI/Form/Field.jsx"; import UIFormSelect from "@js/components/UI/Form/Select.jsx"; import WorkTabsPreservationFileSetDropzone from "@js/components/Work/Tabs/Preservation/FileSetDropzone"; import WorkTabsPreservationFileSetForm from "@js/components/Work/Tabs/Preservation/FileSetForm"; -import classNames from "classnames"; import useAcceptedMimeTypes from "@js/hooks/useAcceptedMimeTypes"; import { useCodeLists } from "@js/context/code-list-context"; import S3ObjectPicker from "@js/components/Work/Tabs/Preservation/S3ObjectPicker" -const modalCss = css` - z-index: 100; -`; - function WorkTabsPreservationFileSetModal({ closeModal, isVisible, @@ -189,113 +191,109 @@ function WorkTabsPreservationFileSetModal({ }; return ( -
-
- - {urlError ? ( -
-
- Error retrieving presigned url -
-
- ) : ( - -
-
-
-

Add Fileset to Work

- -
-
- {uploadError && ( - {uploadError} - )} - {error && } + + + + + + + + + + + Add Fileset to Work + - - - + {urlError ? ( +
+
+ Error retrieving presigned url +
+
+ ) : ( + + +
+
+ {uploadError && ( + {uploadError} + )} + {error && } - {watchRole && ( - <> -
-

Option 1: Drag and Drop File

- + -
+ -
-

Option 2: Choose from S3 Ingest Bucket

- -
- - )} + {watchRole && ( + <> +
+

Option 1: Drag and Drop File

+ +
- {s3UploadLocation && ( - - )} -
+
+

Option 2: Choose from S3 Ingest Bucket

+ +
+ + )} -
- {s3UploadLocation && ( - <> - - - - )} -
-
- -
- )} -
+ {s3UploadLocation && ( + + )} + + + +
+ + + )} + + + ); }