overleaf/services/web/frontend/js/features/settings/components/leave/modal.tsx
ilkin-overleaf d50271c1e9 Merge pull request #7225 from overleaf/ta-leave-modal
[DeleteAccount] Create Modal with Form

GitOrigin-RevId: 611f08c7253f59d91c6937b79c80a386b9d21ccd
2022-04-11 08:03:36 +00:00

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