decord/source/modules/premium/native/gifting/PremiumAnimatedGiftButton.tsx

102 lines
4.4 KiB
TypeScript
Raw Normal View History

2026-08-05 07:35:12 +00:00
// Module ID: 11504
// Function ID: 11505
2026-07-20 16:05:17 +00:00
// Name: PremiumAnimatedGiftButton
2026-08-05 07:35:12 +00:00
// Dependencies: [19, 4247, 21, 4255, 712, 1348, 3959, 589, 500, 4116, 4797, 5586, 2]
2026-07-20 16:05:17 +00:00
// Exports: PremiumAnimatedGiftButton
2026-08-05 07:35:12 +00:00
// Module 11504 (PremiumAnimatedGiftButton)
2026-07-29 08:29:29 +00:00
import noop from "noop";
import { useRef } from "noop";
import maybeApplyNoTextColorForLightCustomTheme from "maybeApplyNoTextColorForLightCustomTheme";
2026-07-23 10:11:24 +00:00
import { jsx } from "jsxProd";
2026-07-29 08:29:29 +00:00
import createCacheKey from "createCacheKey";
2026-07-23 10:11:24 +00:00
let require = arg1;
2026-07-29 08:29:29 +00:00
let closure_7 = createCacheKey.createStyles((width, marginHorizontal) => {
let obj = { container: null, containerRefresh: null, animation: null, animationRefresh: null };
obj = { backgroundColor: importDefault(712).colors.REDESIGN_BUTTON_TERTIARY_BACKGROUND, width, height: width, borderRadius: importDefault(712).radii.round, marginHorizontal, display: "flex", alignItems: "center", justifyContent: "center" };
obj[0] = obj;
obj = { width, height: width, borderRadius: importDefault(712).radii.sm, marginHorizontal, display: "flex", alignItems: "center", justifyContent: "center" };
obj[1] = obj;
obj[2] = { width: 30, height: 30 };
obj[3] = { width: 24, height: 24 };
2026-07-20 16:05:17 +00:00
return obj;
});
2026-07-23 10:11:24 +00:00
const result = require("jsxProd").fileFinishedImporting("modules/premium/native/gifting/PremiumAnimatedGiftButton.tsx");
2026-07-20 16:05:17 +00:00
export const PremiumAnimatedGiftButton = function PremiumAnimatedGiftButton(arg0) {
let accessibilityState;
let active;
let activeStyle;
let animationDataUrl;
let channelId;
let disabled;
let loop;
let onAnimationFinished;
let style;
({ active, disabled, accessibilityState } = arg0);
({ style, activeStyle, channelId, animationDataUrl, onAnimationFinished, loop } = arg0);
2026-07-29 08:29:29 +00:00
let obj = require(1348) /* useIsMobileVisualRefreshExperimentEnabled */;
2026-07-20 16:05:17 +00:00
const enabled = obj.useMobileVisualRefreshConfig({ location: "PremiumAnimatedGiftButton" }).enabled;
2026-08-05 07:35:12 +00:00
let obj1 = require(3959) /* map */;
2026-07-29 08:29:29 +00:00
const token = obj1.useToken(stateFromStores(712).modules.mobile.CHAT_INPUT_ACTION_BUTTON_SIZE);
2026-08-05 07:35:12 +00:00
let obj2 = require(3959) /* map */;
2026-07-29 08:29:29 +00:00
const token1 = obj2.useToken(stateFromStores(712).modules.mobile.CHAT_INPUT_ACTION_BUTTON_MARGIN);
2026-08-05 07:35:12 +00:00
const token2 = require(3959) /* map */.useToken(stateFromStores(712).modules.mobile.CHAT_INPUT_BUTTON_MIN_TOUCH_TARGET_SIZE);
2026-07-29 08:29:29 +00:00
const tmp7 = callback(token, token1);
2026-07-20 16:05:17 +00:00
const bound = Math.max(0, (token2 - token) / 2);
2026-07-29 08:29:29 +00:00
const tmp9 = useRef(null);
require = tmp9;
2026-08-05 07:35:12 +00:00
const obj4 = require(3959) /* map */;
2026-07-29 08:29:29 +00:00
const tmp3 = stateFromStores;
const items = [maybeApplyNoTextColorForLightCustomTheme];
stateFromStores = require(589) /* initialize */.useStateFromStores(items, () => useReducedMotion.useReducedMotion);
2026-07-20 16:05:17 +00:00
const items1 = [channelId, stateFromStores];
const effect = React.useEffect(() => {
if (!stateFromStores) {
if (obj.isIOS()) {
2026-07-29 08:29:29 +00:00
if (tmp9 != null) {
const current = tmp9.current;
if (current != null) {
current.reset();
}
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
if (tmp9 != null) {
const current2 = tmp9.current;
if (current2 != null) {
current2.play();
}
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj = tmp9(outer1_2[8]);
2026-07-20 16:05:17 +00:00
}
}, items1);
let FadeOut;
if (!stateFromStores) {
2026-08-05 07:35:12 +00:00
FadeOut = tmp(4116).FadeOut;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj = { exiting: FadeOut, children: null };
const items2 = [enabled ? tmp7.containerRefresh : tmp7.container, style, ];
2026-07-20 16:05:17 +00:00
if (active) {
active = !disabled;
}
if (active) {
active = activeStyle;
}
2026-07-29 08:29:29 +00:00
obj = { style: items2, hitSlop: null, accessibilityRole: "button", accessibilityState: null };
2026-07-20 16:05:17 +00:00
items2[2] = active;
let tmp14;
if (bound > 0) {
tmp14 = bound;
}
2026-07-29 08:29:29 +00:00
obj[1] = tmp14;
2026-07-20 16:05:17 +00:00
obj1 = { disabled };
const merged = Object.assign(accessibilityState);
2026-07-29 08:29:29 +00:00
obj[3] = obj1;
2026-07-20 16:05:17 +00:00
const merged1 = Object.assign(arg0);
2026-07-29 08:29:29 +00:00
obj2 = { ref: tmp9, style: enabled ? tmp7.animationRefresh : tmp7.animation, source: { uri: animationDataUrl }, loop, autoPlay: false, onAnimationFinish: onAnimationFinished };
2026-08-05 07:35:12 +00:00
obj.children = jsx(tmp3(5586), { ref: tmp9, style: enabled ? tmp7.animationRefresh : tmp7.animation, source: { uri: animationDataUrl }, loop, autoPlay: false, onAnimationFinish: onAnimationFinished });
obj[1] = jsx(require(4797) /* PressableBase */.PressableOpacity, { style: items2, hitSlop: null, accessibilityRole: "button", accessibilityState: null });
return jsx(stateFromStores(4116).View, { style: items2, hitSlop: null, accessibilityRole: "button", accessibilityState: null });
2026-07-20 16:05:17 +00:00
};