Files
discord-decomp/modules/quests/native/BountiesModal/BountiesScrollIndicatorOverlay.tsx
T
2026-11-01 12:12:55 +02:00

187 lines
6.6 KiB
TypeScript

// Metro module 14064 (f14065).
import { useState, useEffect, useCallback } from "react";
import { StyleSheet } from "react-native";
import * as _timingPresets from "../../../../design/animation/reanimated/timing/timingPresets";
import { timingSlowDuration } from "../../../../design/animation/reanimated/timing/timingPresets";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import * as _ReanimatedRexport from "../../../reanimated/ReanimatedRexport";
import ReanimatedRexport, { useAnimatedStyle } from "../../../reanimated/ReanimatedRexport";
import * as _timing from "../../../../design/animation/reanimated/timing/timing";
import Module4611 from "../../../../_bundle/Module4611";
import BountiesScrollIndicatorAnimation from "./BountiesScrollIndicatorAnimation";
import { Text } from "../../../../design/components/Text/native/Text";
import * as _index_native from "../../../../intl/index.native";
import { intl } from "../../../../intl/index.native";
function $mk118410($env) {
return () => {
let env32054;
const r8 = $env.$parent.$parent[1];
const r0 = $env[0];
r8(r0);
const r10 = $env.$parent;
const r11 = env32054 = {
$parent: r10
};
env32054[0] = !r0;
const r6 = setTimeout;
const r12 = r0 ? r10.$parent.$parent[9] : 5000;
r10[0] = r6($mk118410(r11), r12);
};
}
let c9835_11, c9835_12, c9835_13, c9835_14;
let env9835 = {};
const _excluded = ["rgba(0,0,0,0)", "rgba(0,0,0,0.7)", "rgba(0,0,0,1)"];
const c9835_9 = 5000 + timingSlowDuration;
const useStyles = createStyles(() => ({
scrollIndicator: {
position: "absolute",
left: 0,
right: 0,
bottom: 0,
height: "45%",
alignItems: "center",
justifyContent: "center",
paddingHorizontal: Module712.space.PX_16
},
scrollIndicatorContent: {
position: "absolute",
bottom: 124,
left: 0,
right: 0,
alignItems: "center",
justifyContent: "flex-start",
gap: Module712.space.PX_8
},
scrollIndicatorText: {
textAlign: "center"
}
}));
c9835_11 = {
code: "function BountiesScrollIndicatorOverlayTsx1(){const{withTiming,visible,enabled,timingSlow,timingStandard,runOnJS,animationCallbackJSThread}=this.__closure;return{opacity:withTiming(visible?1:0,enabled?timingSlow:timingStandard,'respect-motion-settings',function(){'worklet';runOnJS(animationCallbackJSThread)();})};}"
};
c9835_12 = {
code: "function BountiesScrollIndicatorOverlayTsx2(){const{runOnJS,animationCallbackJSThread}=this.__closure;runOnJS(animationCallbackJSThread)();}"
};
c9835_13 = {
code: "function BountiesScrollIndicatorOverlayTsx3(){const{withTiming,visible,isEndCardVisible,enabled,timingStandard,timingSlow}=this.__closure;return{opacity:withTiming(visible&&!isEndCardVisible?1:0,isEndCardVisible||!enabled?timingStandard:timingSlow)};}"
};
c9835_14 = {
code: "function BountiesScrollIndicatorOverlayTsx4(){const{withTiming,visible,timingStandard}=this.__closure;return{transform:[{scale:withTiming(visible?1:0.9,timingStandard)}]};}"
};
export default function BountiesScrollIndicatorOverlay(props) {
let state, setState, callback;
const { enabled, isEndCardVisible, opacityStyle } = props;
state = void 0;
setState = void 0;
callback = void 0;
const styles = useStyles();
let env20880 = {
$parent: env9835
};
env20880[0] = enabled;
env20880[1] = void 0;
const [state2, setState2] = useState(true);
env20880[1] = setState2;
const [state3, setState3] = useState(enabled);
if (enabled !== state3) {
setState3(enabled);
if (enabled) {
setState2(true);
}
}
useEffect(() => {
if (env20880[0]) {
let env30695;
let env30696;
const r6 = env30695 = {
$parent: env20880
};
const r2 = env30696 = {
$parent: r6
};
env30696[0] = false;
env30695[0] = setTimeout($mk118410(r2), c9835_9);
return () => clearTimeout(env30695[0]);
}
}, [enabled]);
state = enabled ? state2 : enabled;
let isFadingInContent;
[isFadingInContent, setState] = useState(state);
const [state4, setState4] = useState(state);
if (state !== state4) {
setState4(state);
if (state) {
setState(true);
}
}
callback = useCallback(() => {
setState(false);
}, []);
const E = () => {
const r0 = state ? 1 : 0;
const r6 = enabled ? _timingPresets.timingSlow : _timingPresets.timingStandard;
const t = function t() {
_ReanimatedRexport.runOnJS(callback)();
};
t.__closure = {
runOnJS: _ReanimatedRexport.runOnJS,
animationCallbackJSThread: callback
};
t.__workletHash = 7847207274031;
t.__initData = c9835_12;
return {
opacity: _timing.withTiming(r0, r6, "respect-motion-settings", t)
};
};
E.__closure = {
withTiming: _timing.withTiming,
visible: state,
enabled,
timingSlow: _timingPresets.timingSlow,
timingStandard: _timingPresets.timingStandard,
runOnJS: _ReanimatedRexport.runOnJS,
animationCallbackJSThread: callback
};
E.__workletHash = 2813930896935;
E.__initData = c9835_11;
const animatedStyle = useAnimatedStyle(E);
const j = () => ({
opacity: _timing.withTiming(state ? isEndCardVisible ? 0 : 1 : 0, !isEndCardVisible && enabled ? _timingPresets.timingSlow : _timingPresets.timingStandard)
});
j.__closure = {
withTiming: _timing.withTiming,
visible: state,
isEndCardVisible,
enabled,
timingStandard: _timingPresets.timingStandard,
timingSlow: _timingPresets.timingSlow
};
j.__workletHash = 12172713560290;
j.__initData = c9835_13;
const animatedStyle2 = useAnimatedStyle(j);
const A = () => ({
transform: [{
scale: _timing.withTiming(state ? 1 : 0.9, _timingPresets.timingStandard)
}]
});
A.__closure = {
withTiming: _timing.withTiming,
visible: state,
timingStandard: _timingPresets.timingStandard
};
A.__workletHash = 4041303236067;
A.__initData = c9835_14;
return <ReanimatedRexport.View style={[styles.scrollIndicator, opacityStyle]} pointerEvents="none">
<ReanimatedRexport.View style={[StyleSheet.absoluteFill, animatedStyle2]}>
<Module4611 colors={_excluded} style={StyleSheet.absoluteFill} />
</ReanimatedRexport.View>
<ReanimatedRexport.View style={[styles.scrollIndicatorContent, [animatedStyle, useAnimatedStyle(A)]]}>
<BountiesScrollIndicatorAnimation visible={state} isFadingInContent={isFadingInContent} />
<Text variant="text-sm/semibold" color="text-default" style={styles.scrollIndicatorText}>
{intl.string(_index_native.t.eafsh4)}
</Text>
</ReanimatedRexport.View>
</ReanimatedRexport.View>;
};