mirror of
https://github.com/suitenumerique/docs.git
synced 2026-09-14 05:37:53 +02:00
♻️(frontend) adapt modals to ModalDefaultVariantProps
cunningham-react 4.3.0 splits Modal props per variant. Switch AlertModal and SideModal from the now-removed ModalProps alias to the more precise ModalDefaultVariantProps type so the modal wrappers keep type-checking against the new API. Signed-off-by: Nathan Panchout <nathanpanchout@hotmail.com>
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
import { Modal, ModalSize } from '@gouvfr-lasuite/cunningham-react';
|
||||
import { ComponentPropsWithRef, PropsWithChildren } from 'react';
|
||||
import {
|
||||
Modal,
|
||||
ModalDefaultVariantProps,
|
||||
ModalSize,
|
||||
} from '@gouvfr-lasuite/cunningham-react';
|
||||
import { PropsWithChildren } from 'react';
|
||||
import { createGlobalStyle } from 'styled-components';
|
||||
|
||||
interface SideModalStyleProps {
|
||||
@@ -35,7 +39,7 @@ const SideModalStyle = createGlobalStyle<SideModalStyleProps>`
|
||||
}
|
||||
`;
|
||||
|
||||
type SideModalType = Omit<ComponentPropsWithRef<typeof Modal>, 'size'>;
|
||||
type SideModalType = Omit<ModalDefaultVariantProps, 'size'>;
|
||||
|
||||
type SideModalProps = SideModalType & Partial<SideModalStyleProps>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user