mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-12 13:21:37 -05:00
f78e619d87
[web ] Bootstrap 5 - rename the wrapper components and restructure GitOrigin-RevId: 7a76903df81cd546e9e469f24c4f203ea6a61672
36 lines
791 B
TypeScript
36 lines
791 B
TypeScript
import { useState, useCallback } from 'react'
|
|
import LeaveModalContent from './modal-content'
|
|
import OLModal from '@/features/ui/components/ol/ol-modal'
|
|
|
|
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 (
|
|
<OLModal
|
|
animation
|
|
show={isOpen}
|
|
onHide={handleHide}
|
|
id="leave-modal"
|
|
bs3Props={{ backdrop: 'static' }}
|
|
>
|
|
<LeaveModalContent
|
|
handleHide={handleHide}
|
|
inFlight={inFlight}
|
|
setInFlight={setInFlight}
|
|
/>
|
|
</OLModal>
|
|
)
|
|
}
|
|
|
|
export default LeaveModal
|