66 lines
2.0 KiB
TypeScript
66 lines
2.0 KiB
TypeScript
// Metro module 15252 (f15253).
|
|
import { forwardRef, useRef, useCallback, useImperativeHandle } from "react";
|
|
import * as _ReanimatedRexport from "../../reanimated/ReanimatedRexport";
|
|
import ReanimatedRexport, { useSharedValue, useAnimatedStyle } from "../../reanimated/ReanimatedRexport";
|
|
import { withTiming } from "../../../design/animation/reanimated/timing/timing";
|
|
const __initData = {
|
|
code: "function FadeInOutTsx1(){const{opacity}=this.__closure;return{opacity:opacity.get()};}"
|
|
};
|
|
const __initData2 = {
|
|
code: "function FadeInOutTsx2(finished){const{runOnJS,handleTransitionFinished}=this.__closure;if(finished){runOnJS(handleTransitionFinished)();}}"
|
|
};
|
|
const r22 = forwardRef(function({ children, duration, style }, a1) {
|
|
let ref, callback;
|
|
ref = void 0;
|
|
callback = void 0;
|
|
const sharedValue = useSharedValue(0);
|
|
const h = () => ({
|
|
opacity: sharedValue.get()
|
|
});
|
|
h.__closure = {
|
|
opacity: sharedValue
|
|
};
|
|
h.__workletHash = 8749472415282;
|
|
h.__initData = __initData;
|
|
const animatedStyle = useAnimatedStyle(h);
|
|
ref = useRef(null);
|
|
callback = useCallback(() => {
|
|
const current = ref.current;
|
|
if (current != null) {
|
|
current.call(ref);
|
|
}
|
|
}, [ref]);
|
|
useImperativeHandle(a1, () => ({
|
|
componentDidAppear: () => {
|
|
sharedValue.set(withTiming(1, {
|
|
duration
|
|
}));
|
|
},
|
|
componentDidEnter: () => {
|
|
sharedValue.set(withTiming(1, {
|
|
duration
|
|
}));
|
|
},
|
|
componentWillLeave: (a0) => {
|
|
ref.current = a0;
|
|
const r6 = {
|
|
duration
|
|
};
|
|
const t = function t(a0) {
|
|
if (a0) {
|
|
_ReanimatedRexport.runOnJS(callback)();
|
|
}
|
|
};
|
|
t.__closure = {
|
|
runOnJS: _ReanimatedRexport.runOnJS,
|
|
handleTransitionFinished: callback
|
|
};
|
|
t.__workletHash = 7644958904451;
|
|
t.__initData = __initData2;
|
|
sharedValue.set(withTiming(0, r6, "respect-motion-settings", t));
|
|
}
|
|
}));
|
|
return <ReanimatedRexport.View style={[style, animatedStyle]}>{children}</ReanimatedRexport.View>;
|
|
});
|
|
export default r22;
|