import { Platform, requireNativeComponent, type ViewProps } from 'react-native'
import type {
ZoomTransitionSourceProps,
ZoomTransitionEnablerProps,
ZoomTransitionAlignmentRectDetectorProps,
} from './types'
export type {
ZoomTransitionSourceProps,
ZoomTransitionEnablerProps,
ZoomTransitionAlignmentRectDetectorProps,
DismissalBoundsRect,
SourceAlignmentRect,
} from './types'
const isAvailable = Platform.OS === 'ios' && !Platform.isTV
const ZoomEnablerNative = isAvailable
? requireNativeComponent<
ViewProps & { zoomTransitionSourceIdentifier: string; dismissalBoundsRect?: any }
>('VxrnZoomEnabler')
: null
export function ZoomTransitionEnabler(props: ZoomTransitionEnablerProps) {
if (!ZoomEnablerNative) return null
return (
)
}
const ZoomSourceNative = isAvailable
? requireNativeComponent('VxrnZoomSource')
: null
export function ZoomTransitionSource(props: ZoomTransitionSourceProps) {
if (!ZoomSourceNative) return null
return
}
const ZoomAlignmentNative = isAvailable
? requireNativeComponent('VxrnZoomAlignment')
: null
export function ZoomTransitionAlignmentRectDetector(
props: ZoomTransitionAlignmentRectDetectorProps
) {
if (!ZoomAlignmentNative) return null
return (
)
}