decord/source/modules/premium/native/gifting/PremiumGiftingPromotionSuccessActions.tsx
github-actions da5b5e5efe chore: update source for alpha 346.6
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4821.js (118.4 MB)
2026-09-12 13:45:10 +00:00

92 lines
4 KiB
TypeScript

// Module ID: 11210
// Function ID: 11211
// Name: PremiumGiftingPromotionSuccessActions
// Dependencies: [19, 17, 21, 4636, 576, 10827, 1483, 10871, 11176, 10790, 11211, 10882, 1114, 2460, 5056, 2]
// Exports: default
// Module 11210 (PremiumGiftingPromotionSuccessActions)
import nativeDefault from "native" /* 576 */;
import PremiumGiftModal from "PremiumGiftModal" /* 10790 */;
import ProductPurchaseSuccessActionCreatorsDefault from "ProductPurchaseSuccessActionCreators" /* 11211 */;
import noop from "module_19" /* 19 */;
require = fn;
const View = fn(17).View;
const jsxProd = fn(21);
({ jsx: hasOwnProperty, jsxs: metroRequire } = jsxProd);
const createStyles = fn(4636);
let obj2 = { container: { flexDirection: "column", alignItems: "center", gap: nativeDefault.space.PX_16 }, promoDetails: null };
let obj3 = { flexDirection: "column", alignItems: "center", gap: nativeDefault.space.PX_16 };
obj2.promoDetails = { alignSelf: "stretch", paddingVertical: nativeDefault.space.PX_12, paddingHorizontal: nativeDefault.space.PX_16, borderRadius: nativeDefault.radii.md, backgroundColor: nativeDefault.colors.BACKGROUND_MOD_SUBTLE };
let closure_7 = createStyles.createStyles(obj2);
const size = fn(2);
const result = size.fileFinishedImporting("modules/premium/native/gifting/PremiumGiftingPromotionSuccessActions.tsx");
export default function PremiumGiftingPromotionSuccessActions(purchase) {
let onClose;
let navigation;
let onCancel;
let tmp = closure_7();
const nativeGiftContext = onClose(navigation[5]).useNativeGiftContext();
onClose = nativeGiftContext.onClose;
const prePurchaseGiftingBadgeProgress = nativeGiftContext.prePurchaseGiftingBadgeProgress;
let obj = onClose(navigation[5]);
navigation = onClose(navigation[6]).useNavigation();
const GiftingBadgeExperiment = onClose(navigation[7]).GiftingBadgeExperiment;
const enabled = GiftingBadgeExperiment.useConfig({ location: "PremiumGiftingPromotionSuccessActions" }).enabled;
let obj2 = onClose(navigation[6]);
const fetchCollectiblesProduct = onClose(navigation[8]).useFetchCollectiblesProduct(purchase.purchase.skuId);
const product = fetchCollectiblesProduct.product;
c4 = product;
let tmp12Result = null != product;
if (tmp12Result) {
tmp12Result = product.items.length > 0;
}
const items = [enabled, prePurchaseGiftingBadgeProgress, navigation];
onCancel = enabled.useCallback(() => {
let tmp = enabled;
if (enabled) {
tmp = null != prePurchaseGiftingBadgeProgress;
}
if (tmp) {
const obj = { currentProgress: prePurchaseGiftingBadgeProgress };
navigation.navigate(PremiumGiftModal.PremiumGiftScreens.GIFTING_BADGE, obj);
}
}, items);
const items1 = [product, onClose, onCancel, enabled, prePurchaseGiftingBadgeProgress, navigation];
const obj4 = { style: tmp.container, children: null };
const callback1 = enabled.useCallback(() => {
if (null != c4) {
const obj3 = { product: tmp, onCancel };
ProductPurchaseSuccessActionCreatorsDefault.open(obj3);
} else {
if (enabled) {
if (null != prePurchaseGiftingBadgeProgress) {
const obj = { currentProgress: tmp3 };
navigation.navigate(PremiumGiftModal.PremiumGiftScreens.GIFTING_BADGE, obj);
}
}
onClose();
}
}, items1);
if (tmp12Result) {
const obj5 = { style: tmp.promoDetails, product, title: null, subtitle: null };
const intl = tmp2(tmp3[12]).intl;
obj5.title = intl.string(prePurchaseGiftingBadgeProgress(tmp3[13]).XeLTZl);
let name;
if (product != null) {
name = product.name;
}
obj5.subtitle = name;
tmp12Result = onCancel(tmp2(tmp3[11]).PremiumGiftPromotionCollectibleRewardDetails, obj5);
}
const items2 = [tmp12Result, ];
const obj6 = { grow: true, text: null, loading: null, onPress: null };
const intl2 = tmp2(tmp3[12]).intl;
obj6.text = intl2.string(onClose(navigation[12]).t.kMYVwv);
obj6.loading = fetchCollectiblesProduct.isFetching;
obj6.onPress = callback1;
items2[1] = onCancel(onClose(navigation[14]).Button, obj6);
obj4.children = items2;
return closure_6(c4, obj4);
};