overleaf-cep/services/web/frontend/js/features/settings/components/leave/modal.tsx
Rebeka Dekany 562ef81389 Cleanup Bootstrap 3 code in the Account settings page (#24058)
* Remove the Bootstrap 5 version utilities

* Remove Account settings LESS stylesheet and unused styles

* Prefer using the OLFormText wrapper component instead of FormText

* Remove the Bootstrap 3 version stories

* Replace Font Awesome icons to Material icons

* Fix the heading hierarchy

* Cleanup unused translation

* Restore ellipsis to the text of two loading spinners

* Add loading button tests back and add some button loading labels

---------

Co-authored-by: Tim Down <158919+timdown@users.noreply.github.com>
GitOrigin-RevId: 283a9167c8c78bf0fe5062840ded6917dcd6263b
2025-03-24 10:49:33 +00:00

30 lines
722 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">
<LeaveModalContent
handleHide={handleHide}
inFlight={inFlight}
setInFlight={setInFlight}
/>
</OLModal>
)
}
export default LeaveModal