mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
d50271c1e9
[DeleteAccount] Create Modal with Form GitOrigin-RevId: 611f08c7253f59d91c6937b79c80a386b9d21ccd
36 lines
809 B
TypeScript
36 lines
809 B
TypeScript
import { useState, useCallback } from 'react'
|
|
import AccessibleModal from '../../../../shared/components/accessible-modal'
|
|
import LeaveModalContent from './modal-content'
|
|
|
|
type LeaveModalProps = {
|
|
isOpen: boolean
|
|
handleClose: () => void
|
|
}
|
|
|
|
function LeaveModal({ isOpen, handleClose }: LeaveModalProps) {
|
|
const [inFlight, setInFlight] = useState(false)
|
|
|
|
const handleHide = useCallback(() => {
|
|
if (!inFlight) {
|
|
handleClose()
|
|
}
|
|
}, [handleClose, inFlight])
|
|
|
|
return (
|
|
<AccessibleModal
|
|
animation
|
|
show={isOpen}
|
|
onHide={handleHide}
|
|
id="leave-modal"
|
|
backdrop="static"
|
|
>
|
|
<LeaveModalContent
|
|
handleHide={handleHide}
|
|
inFlight={inFlight}
|
|
setInFlight={setInFlight}
|
|
/>
|
|
</AccessibleModal>
|
|
)
|
|
}
|
|
|
|
export default LeaveModal
|