@@ -12,6 +12,7 @@ import { modalInstance } from "components/GlobalInstances";
1212
1313type ModalWrapperProps = {
1414 $width ?: string | number ;
15+ $animationStyle ?:any
1516} ;
1617
1718type Model = {
@@ -30,6 +31,10 @@ const ModalWrapper = styled.div<ModalWrapperProps>`
3031 padding: 0 0 16px;
3132 pointer-events: auto;
3233 will-change: transform;
34+ animation: ${ ( props ) => props . $animationStyle ?. animation } ;
35+ animation-delay: ${ ( props ) => props . $animationStyle ?. animationDelay } ;
36+ animation-duration: ${ ( props ) => props . $animationStyle ?. animationDuration } ;
37+ animation-iteration-count: ${ ( props ) => props . $animationStyle ?. animationIterationCount } ;
3338` ;
3439
3540const ModalHeaderWrapper = styled . div < { $draggable ?: boolean } > `
@@ -205,6 +210,7 @@ export type CustomModalProps = {
205210 children ?: JSX . Element | React . ReactNode ;
206211 okButtonType ?: TacoButtonType ;
207212 model ?: Model ;
213+ animationStyle ?:any
208214} & AntdModalProps ;
209215
210216const DEFAULT_PROPS = {
@@ -217,7 +223,7 @@ const DEFAULT_PROPS = {
217223function CustomModalRender ( props : CustomModalProps & ModalFuncProps ) {
218224 return (
219225 < Draggable handle = ".handle" disabled = { ! props . draggable } >
220- < ModalWrapper $width = { props . width } >
226+ < ModalWrapper $width = { props . width } $animationStyle = { props ?. animationStyle } >
221227 < >
222228 < ModalHeaderWrapper className = "handle" $draggable = { props . draggable } >
223229 < ModalHeader
@@ -276,6 +282,7 @@ CustomModal.confirm = (props: {
276282 footer ?: ReactNode ;
277283 type ?: "info" | "warn" | "error" | "success" ;
278284 width ?: number | string ;
285+ animationStyle ?:React . CSSProperties ;
279286} ) : any => {
280287
281288 const defaultConfirmProps : ModalFuncProps = {
@@ -333,6 +340,7 @@ CustomModal.confirm = (props: {
333340 } }
334341 footer = { props . footer }
335342 width = { props . width }
343+ animationStyle = { props . animationStyle }
336344 />
337345 ) ,
338346 } ) ;
0 commit comments