Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Tiny update to delete confirmation modal (#35321)

Joshen Limf08e5a3c179e
diff --git a/apps/studio/components/to-be-cleaned/Storage/StorageExplorer/ConfirmDeleteModal.tsx b/apps/studio/components/to-be-cleaned/Storage/StorageExplorer/ConfirmDeleteModal.tsx
index 6f041a1de0b..1aefdb6456d 100644
--- a/apps/studio/components/to-be-cleaned/Storage/StorageExplorer/ConfirmDeleteModal.tsx
+++ b/apps/studio/components/to-be-cleaned/Storage/StorageExplorer/ConfirmDeleteModal.tsx
@@ -1,6 +1,7 @@
import { noop } from 'lodash'
import { useEffect, useState } from 'react'
-import { Alert, Button, Modal } from 'ui'
+
+import ConfirmationModal from 'ui-patterns/Dialogs/ConfirmationModal'
import { StorageItem } from '../Storage.types'
interface ConfirmDeleteModalProps {
@@ -10,7 +11,7 @@ interface ConfirmDeleteModalProps {
onSelectDelete: () => void
}
-const ConfirmDeleteModal = ({
+export const ConfirmDeleteModal = ({
visible = false,
selectedItemsToDelete = [],
onSelectCancel = noop,
@@ -42,28 +43,19 @@ const ConfirmDeleteModal = ({
}
return (
- <Modal
+ <ConfirmationModal
visible={visible}
- header={<span className="break-words">{title}</span>}
+ title={<span className="break-words">{title}</span>}
size="medium"
onCancel={onSelectCancel}
- customFooter={
- <div className="flex items-center gap-2">
- <Button type="default" disabled={deleting} onClick={onSelectCancel}>
- Cancel
- </Button>
- <Button type="danger" disabled={deleting} loading={deleting} onClick={onConfirmDelete}>
- {deleting ? 'Deleting' : 'Delete'}
- </Button>
- </div>
- }
- >
- <Modal.Content>
- <Alert withIcon variant="danger" title={`This action cannot be undone.`}>
- {description}
- </Alert>
- </Modal.Content>
- </Modal>
+ onConfirm={onConfirmDelete}
+ variant="destructive"
+ alert={{
+ base: { variant: 'destructive' },
+ title: 'This action cannot be undone',
+ description,
+ }}
+ />
)
}
diff --git a/apps/studio/components/to-be-cleaned/Storage/StorageExplorer/StorageExplorer.tsx b/apps/studio/components/to-be-cleaned/Storage/StorageExplorer/StorageExplorer.tsx
index a6d131379d2..020eacb45ab 100644
--- a/apps/studio/components/to-be-cleaned/Storage/StorageExplorer/StorageExplorer.tsx
+++ b/apps/studio/components/to-be-cleaned/Storage/StorageExplorer/StorageExplorer.tsx
@@ -9,7 +9,7 @@ import { IS_PLATFORM } from 'lib/constants'
import { useStorageStore } from 'localStores/storageExplorer/StorageExplorerStore'
import { useStorageExplorerStateSnapshot } from 'state/storage-explorer'
import { STORAGE_ROW_TYPES, STORAGE_VIEWS } from '../Storage.constants'
-import ConfirmDeleteModal from './ConfirmDeleteModal'
+import { ConfirmDeleteModal } from './ConfirmDeleteModal'
import CustomExpiryModal from './CustomExpiryModal'
import FileExplorer from './FileExplorer'
import FileExplorerHeader from './FileExplorerHeader'