22 lines
1.2 KiB
TypeScript
22 lines
1.2 KiB
TypeScript
// Metro module 8438 (f8439).
|
|
import { useContext, useState, useEffect } from "react";
|
|
import { StyleSheet } from "react-native";
|
|
import ReanimatedRexport from "../../../../modules/reanimated/ReanimatedRexport";
|
|
import { CoachmarkContainer } from "./Coachmark.native";
|
|
import { AccessibilityPreferencesContext } from "../../../../_bundle/Module3908";
|
|
import { tooltipEnterExitAnimation } from "../../Tooltip/native/TooltipConstants.native";
|
|
import AnimatedEnterExitItem from "../../AnimatedEnterExitItem/native/AnimatedEnterExitItem";
|
|
const renderTooltipItem = (a0, a1) => <ReanimatedRexport.View style={[a1, StyleSheet.absoluteFill]} pointerEvents="box-none">
|
|
{a0 != null ? <CoachmarkContainer {...a0} enterExitAnimatedStyles={a1} /> : null}
|
|
</ReanimatedRexport.View>;
|
|
export function AnimatedCoachmark(props) {
|
|
const { visible, ...rest } = props;
|
|
const enabled = useContext(AccessibilityPreferencesContext).reducedMotion.enabled;
|
|
const [state, setState] = useState(visible);
|
|
const entering = tooltipEnterExitAnimation(rest.position);
|
|
useEffect(() => {
|
|
setState(visible);
|
|
}, [visible]);
|
|
return <AnimatedEnterExitItem useReducedMotion={enabled} item={state ? rest : void 0} entering={entering} exiting={entering} renderItem={renderTooltipItem} />;
|
|
}
|