|
@@ -1,4 +1,11 @@
|
|
|
-import { Modal as BS5Modal } from 'react-bootstrap-5'
|
|
|
|
|
|
|
+import {
|
|
|
|
|
+ Modal as BS5Modal,
|
|
|
|
|
+ ModalProps,
|
|
|
|
|
+ ModalHeaderProps,
|
|
|
|
|
+ ModalTitleProps,
|
|
|
|
|
+ ModalBody,
|
|
|
|
|
+ ModalFooterProps,
|
|
|
|
|
+} from 'react-bootstrap-5'
|
|
|
import {
|
|
import {
|
|
|
Modal as BS3Modal,
|
|
Modal as BS3Modal,
|
|
|
ModalProps as BS3ModalProps,
|
|
ModalProps as BS3ModalProps,
|
|
@@ -10,25 +17,25 @@ import {
|
|
|
import BootstrapVersionSwitcher from '@/features/ui/components/bootstrap-5/bootstrap-version-switcher'
|
|
import BootstrapVersionSwitcher from '@/features/ui/components/bootstrap-5/bootstrap-version-switcher'
|
|
|
import AccessibleModal from '@/shared/components/accessible-modal'
|
|
import AccessibleModal from '@/shared/components/accessible-modal'
|
|
|
|
|
|
|
|
-type OLModalProps = React.ComponentProps<typeof BS5Modal> & {
|
|
|
|
|
|
|
+type OLModalProps = ModalProps & {
|
|
|
bs3Props?: Record<string, unknown>
|
|
bs3Props?: Record<string, unknown>
|
|
|
size?: 'sm' | 'lg'
|
|
size?: 'sm' | 'lg'
|
|
|
onHide: () => void
|
|
onHide: () => void
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-type OLModalHeaderProps = React.ComponentProps<typeof BS5Modal> & {
|
|
|
|
|
|
|
+type OLModalHeaderProps = ModalHeaderProps & {
|
|
|
bs3Props?: Record<string, unknown>
|
|
bs3Props?: Record<string, unknown>
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-type OLModalTitleProps = React.ComponentProps<typeof BS5Modal> & {
|
|
|
|
|
|
|
+type OLModalTitleProps = ModalTitleProps & {
|
|
|
bs3Props?: Record<string, unknown>
|
|
bs3Props?: Record<string, unknown>
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-type OLModalBodyProps = React.ComponentProps<typeof BS5Modal> & {
|
|
|
|
|
|
|
+type OLModalBodyProps = React.ComponentProps<typeof ModalBody> & {
|
|
|
bs3Props?: Record<string, unknown>
|
|
bs3Props?: Record<string, unknown>
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-type OLModalFooterProps = React.ComponentProps<typeof BS5Modal> & {
|
|
|
|
|
|
|
+type OLModalFooterProps = ModalFooterProps & {
|
|
|
bs3Props?: Record<string, unknown>
|
|
bs3Props?: Record<string, unknown>
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -54,11 +61,7 @@ export default function OLModal({ children, ...props }: OLModalProps) {
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-export function OLModalHeader({
|
|
|
|
|
- children,
|
|
|
|
|
- closeButton,
|
|
|
|
|
- ...props
|
|
|
|
|
-}: OLModalHeaderProps) {
|
|
|
|
|
|
|
+export function OLModalHeader({ children, ...props }: OLModalHeaderProps) {
|
|
|
const { bs3Props, ...bs5Props } = props
|
|
const { bs3Props, ...bs5Props } = props
|
|
|
|
|
|
|
|
const bs3ModalProps: BS3ModalHeaderProps = {
|
|
const bs3ModalProps: BS3ModalHeaderProps = {
|
|
@@ -69,16 +72,8 @@ export function OLModalHeader({
|
|
|
}
|
|
}
|
|
|
return (
|
|
return (
|
|
|
<BootstrapVersionSwitcher
|
|
<BootstrapVersionSwitcher
|
|
|
- bs3={
|
|
|
|
|
- <BS3Modal.Header {...bs3ModalProps} closeButton={closeButton}>
|
|
|
|
|
- {children}
|
|
|
|
|
- </BS3Modal.Header>
|
|
|
|
|
- }
|
|
|
|
|
- bs5={
|
|
|
|
|
- <BS5Modal.Header {...bs5Props} closeButton={closeButton}>
|
|
|
|
|
- {children}
|
|
|
|
|
- </BS5Modal.Header>
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ bs3={<BS3Modal.Header {...bs3ModalProps}>{children}</BS3Modal.Header>}
|
|
|
|
|
+ bs5={<BS5Modal.Header {...bs5Props}>{children}</BS5Modal.Header>}
|
|
|
/>
|
|
/>
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|