Files
discord-decomp/modules/premium/native/gifting/PremiumFeaturesPromotionalLogo.tsx
T
2026-11-01 12:12:55 +02:00

44 lines
1.7 KiB
TypeScript

// Metro module 9712 (f9713).
import { useRef, useState, useEffect } from "react";
import AccessibilityStore from "../../../a11y/AccessibilityStore";
import { useStateFromStores } from "../../../../_bundle/Module589";
import { useAPNGPlayerControls, APNGPlayer } from "../../../image/native/APNGPlayer.android";
import { isAndroid } from "../../../../utils/PlatformUtils";
import useTimeout from "../../../../hooks/useTimeout";
import FastImage from "../../../../components_native/common/FastImage";
export default function PremiumFeaturesPromotionalLogo(props) {
const { rotatingAvatarImageUrl, promoRotatingStyle, shouldAnimate = true } = props;
let aPNGPlayerControls, state, setState;
let c17423_0 = shouldAnimate;
aPNGPlayerControls = void 0;
state = void 0;
setState = void 0;
const stateFromStores = useStateFromStores([AccessibilityStore], () => AccessibilityStore.useReducedMotion);
let r2 = null;
const ref = useRef(null);
aPNGPlayerControls = useAPNGPlayerControls(ref);
[state, setState] = useState(false);
useEffect(() => {
if (isAndroid() && !stateFromStores) {
if (c17423_0) {
aPNGPlayerControls.seek(0);
setState(true);
} else {
setState(false);
aPNGPlayerControls.stop();
}
}
}, [shouldAnimate, aPNGPlayerControls, stateFromStores]);
if (state) {
r2 = 100;
}
useTimeout(() => {
if (state) {
aPNGPlayerControls.play();
}
}, r2);
return isAndroid() && !stateFromStores ? <APNGPlayer ref={ref} url={rotatingAvatarImageUrl} autoplay={false} style={promoRotatingStyle} /> : <FastImage style={promoRotatingStyle} resizeMode="contain" source={{
uri: rotatingAvatarImageUrl
}} />;
};