Skip to content

Commit

Permalink
Merge pull request #439 from lidofinance/feature/ui-916-move-types-to…
Browse files Browse the repository at this point in the history
…-component-file

Feature/UI 916 move types to component file
  • Loading branch information
karinamaulitova authored Aug 2, 2023
2 parents 809ba01 + d1b6bad commit 08009e5
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 30 deletions.
1 change: 0 additions & 1 deletion packages/transition/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
export * from './withTransition'
export * from './types'
28 changes: 0 additions & 28 deletions packages/transition/types.ts

This file was deleted.

29 changes: 28 additions & 1 deletion packages/transition/withTransition.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,35 @@ import {
import { useMergeRefs } from '../hooks'
import { Transition } from 'react-transition-group'
import { DEFAULT_DURATION } from './constants'
import { TransitionWrapperProps, TransitionInnerProps } from './types'

import type {
TransitionProps,
TransitionStatus,
TransitionActions,
} from 'react-transition-group/Transition'

export type TransitionWrapperProps = Partial<
Pick<
TransitionProps<HTMLElement>,
| 'in'
| 'mountOnEnter'
| 'unmountOnExit'
| 'timeout'
| 'addEndListener'
| 'onEnter'
| 'onEntering'
| 'onEntered'
| 'onExit'
| 'onExiting'
| 'onExited'
> &
Pick<TransitionActions, 'appear' | 'enter' | 'exit'>
>

export type TransitionInnerProps = {
duration: number
transitionStatus: TransitionStatus
}
type WrappedProps<T> = Omit<T, keyof TransitionInnerProps> &
TransitionWrapperProps

Expand Down

0 comments on commit 08009e5

Please sign in to comment.