mirror of
https://github.com/overleaf/overleaf.git
synced 2025-12-05 01:10:29 +00:00
* Convert OLModal to named exports only
* Make closeButton the default for OLModalHeader
* Set `closeButton={false}` for modal that is not dismissible
* Fix duplicated imports
* Remove another unnecessary `closeButton` prop
* Fix import
---------
Co-authored-by: Antoine Clausse <antoine.clausse@overleaf.com>
GitOrigin-RevId: ddd7be6e59a966ac634683d2494d6e9d2c3732e6
50 lines
1.1 KiB
TypeScript
50 lines
1.1 KiB
TypeScript
import {
|
|
Modal,
|
|
ModalProps,
|
|
ModalHeaderProps,
|
|
ModalTitleProps,
|
|
ModalFooterProps,
|
|
} from 'react-bootstrap'
|
|
import { ModalBodyProps } from 'react-bootstrap/ModalBody'
|
|
|
|
type OLModalProps = ModalProps & {
|
|
size?: 'sm' | 'lg'
|
|
onHide: () => void
|
|
}
|
|
|
|
type OLModalHeaderProps = ModalHeaderProps & {
|
|
closeButton?: boolean
|
|
}
|
|
|
|
export function OLModal({ children, ...props }: OLModalProps) {
|
|
return <Modal {...props}>{children}</Modal>
|
|
}
|
|
|
|
export function OLModalHeader({
|
|
children,
|
|
closeButton = true,
|
|
...props
|
|
}: OLModalHeaderProps) {
|
|
return (
|
|
<Modal.Header closeButton={closeButton} {...props}>
|
|
{children}
|
|
</Modal.Header>
|
|
)
|
|
}
|
|
|
|
export function OLModalTitle({ children, ...props }: ModalTitleProps) {
|
|
return (
|
|
<Modal.Title as="h2" {...props}>
|
|
{children}
|
|
</Modal.Title>
|
|
)
|
|
}
|
|
|
|
export function OLModalBody({ children, ...props }: ModalBodyProps) {
|
|
return <Modal.Body {...props}>{children}</Modal.Body>
|
|
}
|
|
|
|
export function OLModalFooter({ children, ...props }: ModalFooterProps) {
|
|
return <Modal.Footer {...props}>{children}</Modal.Footer>
|
|
}
|