mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-18 06:13:45 +02:00
Make modals programatically controllable via a HOC
This allows entire components to be unmounted when the modal is hidden without affecting the fade in/out of the modal itself. This also makes it easier to programatically dismiss a modal without having to copy the visibility all over the place, and makes working with props much simpler in those modal components
This commit is contained in:
@@ -65,18 +65,16 @@ export default ({ backup }: Props) => {
|
||||
checksum={backup.sha256Hash}
|
||||
/>
|
||||
}
|
||||
{deleteVisible &&
|
||||
<ConfirmationModal
|
||||
visible={deleteVisible}
|
||||
title={'Delete this backup?'}
|
||||
buttonText={'Yes, delete backup'}
|
||||
onConfirmed={() => doDeletion()}
|
||||
visible={deleteVisible}
|
||||
onDismissed={() => setDeleteVisible(false)}
|
||||
onModalDismissed={() => setDeleteVisible(false)}
|
||||
>
|
||||
Are you sure you wish to delete this backup? This is a permanent operation and the backup cannot
|
||||
be recovered once deleted.
|
||||
</ConfirmationModal>
|
||||
}
|
||||
<SpinnerOverlay visible={loading} fixed/>
|
||||
<DropdownMenu
|
||||
renderToggle={onClick => (
|
||||
|
||||
Reference in New Issue
Block a user