fix(SW-1631): add rate terms modal * fix(SW-1631): add rate terms modal Approved-by: Simon.Emanuelsson
30 lines
689 B
TypeScript
30 lines
689 B
TypeScript
import type { Dispatch, SetStateAction } from 'react'
|
|
|
|
export enum AnimationStateEnum {
|
|
unmounted = 'unmounted',
|
|
hidden = 'hidden',
|
|
visible = 'visible',
|
|
}
|
|
|
|
export type AnimationState = keyof typeof AnimationStateEnum
|
|
|
|
export type ModalProps = {
|
|
onAnimationComplete?: VoidFunction
|
|
title?: string
|
|
subtitle?: string
|
|
withActions?: boolean
|
|
hideHeader?: boolean
|
|
} & (
|
|
| { trigger: JSX.Element; isOpen?: never; onToggle?: never }
|
|
| {
|
|
trigger?: never
|
|
isOpen: boolean
|
|
onToggle: (open: boolean) => void
|
|
}
|
|
)
|
|
|
|
export type InnerModalProps = Omit<ModalProps, 'trigger'> & {
|
|
animation: AnimationState
|
|
setAnimation: Dispatch<SetStateAction<AnimationState>>
|
|
}
|