Skip to content

Commit 77356bf

Browse files
authored
feat(replication): Significantly improve the replication UI behavior (supabase#38237)
1 parent a448877 commit 77356bf

20 files changed

+1195
-806
lines changed

apps/studio/components/interfaces/Database/Replication/DeleteDestination.tsx

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,32 @@ import TextConfirmModal from 'ui-patterns/Dialogs/TextConfirmModal'
22

33
interface DeleteDestinationProps {
44
visible: boolean
5-
setVisible: (value: boolean) => void
6-
onDelete: () => void
75
isLoading: boolean
86
name: string
7+
setVisible: (value: boolean) => void
8+
onDelete: () => void
99
}
1010

11-
const DeleteDestination = ({
11+
export const DeleteDestination = ({
1212
visible,
13-
setVisible,
14-
onDelete,
1513
isLoading,
1614
name,
15+
setVisible,
16+
onDelete,
1717
}: DeleteDestinationProps) => {
1818
return (
19-
<>
20-
<TextConfirmModal
21-
variant={'warning'}
22-
visible={visible}
23-
onCancel={() => setVisible(!visible)}
24-
onConfirm={onDelete}
25-
title="Delete this destination"
26-
loading={isLoading}
27-
confirmLabel={`Delete destination`}
28-
confirmPlaceholder="Type in name of destination"
29-
confirmString={name ?? 'Unknown'}
30-
text={
31-
<>
32-
<span>This will delete the destination</span>{' '}
33-
</>
34-
}
35-
alert={{ title: 'You cannot recover this destination once deleted.' }}
36-
/>
37-
</>
19+
<TextConfirmModal
20+
variant="destructive"
21+
visible={visible}
22+
loading={isLoading}
23+
title="Delete this destination"
24+
confirmLabel={isLoading ? 'Deleting…' : `Delete destination`}
25+
confirmPlaceholder="Type in name of destination"
26+
confirmString={name ?? 'Unknown'}
27+
text={`This will delete the destination "${name}"`}
28+
alert={{ title: 'You cannot recover this destination once deleted.' }}
29+
onCancel={() => setVisible(!visible)}
30+
onConfirm={onDelete}
31+
/>
3832
)
3933
}
40-
41-
export default DeleteDestination

0 commit comments

Comments
 (0)