mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-17 22:03:44 +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:
@@ -35,19 +35,17 @@ export default ({ subuser }: { subuser: Subuser }) => {
|
||||
|
||||
return (
|
||||
<>
|
||||
{showConfirmation &&
|
||||
<ConfirmationModal
|
||||
title={'Delete this subuser?'}
|
||||
buttonText={'Yes, remove subuser'}
|
||||
visible
|
||||
showSpinnerOverlay={loading}
|
||||
onConfirmed={() => doDeletion()}
|
||||
onDismissed={() => setShowConfirmation(false)}
|
||||
onModalDismissed={() => setShowConfirmation(false)}
|
||||
>
|
||||
Are you sure you wish to remove this subuser? They will have all access to this server revoked
|
||||
immediately.
|
||||
</ConfirmationModal>
|
||||
}
|
||||
<button
|
||||
type={'button'}
|
||||
aria-label={'Delete subuser'}
|
||||
|
||||
Reference in New Issue
Block a user