268 lines
11 KiB
TypeScript
268 lines
11 KiB
TypeScript
// Module ID: 9824
|
|
// Function ID: 9825
|
|
// Name: PostPurchaseFooter
|
|
// Dependencies: [19, 17, 8109, 9825, 1369, 21, 4189, 712, 1581, 4395, 4041, 4600, 8768, 1236, 2319, 9826, 4185, 4158, 4159, 9706, 9827, 4005, 1358, 589, 8106, 2]
|
|
// Exports: default
|
|
|
|
// Module 9824 (PostPurchaseFooter)
|
|
import GiftingBadgeIcon from "GiftingBadgeIcon";
|
|
import { View } from "HapticFeedbackTypes";
|
|
import map from "map";
|
|
import getTierForProgress from "getTierForProgress";
|
|
import { ContentDismissActionType } from "ContentDismissActionType";
|
|
import jsxProd from "UNSAFE_isDismissibleContentDismissed";
|
|
import createCacheKey from "createCacheKey";
|
|
|
|
let c10;
|
|
let closure_6;
|
|
let error;
|
|
let metroImportAll;
|
|
let unpackModuleId;
|
|
const require = arg1;
|
|
function PostPurchaseFooter(onSendGift) {
|
|
onSendGift = onSendGift.onSendGift;
|
|
const items = [onSendGift];
|
|
const callback = React.useCallback(() => {
|
|
let arr = outer1_1(outer1_2[9]);
|
|
arr = arr.pop();
|
|
onSendGift();
|
|
}, items);
|
|
let obj = { style: callback6(importDefault(1581)().bottom).footer, children: null };
|
|
const callback1 = React.useCallback(() => {
|
|
let arr = callback(4395);
|
|
arr = arr.pop();
|
|
const rootNavigationRef = onSendGift(4041).getRootNavigationRef();
|
|
if (rootNavigationRef != null) {
|
|
rootNavigationRef.navigate("you");
|
|
}
|
|
}, []);
|
|
obj = { grow: true, variant: "primary", icon: null, text: null, onPress: null };
|
|
obj = { size: "sm", color: null };
|
|
obj[1] = importDefault(712).colors.CONTROL_PRIMARY_TEXT_DEFAULT;
|
|
obj[2] = callback4(onSendGift(8768).GiftIcon, obj);
|
|
const intl = onSendGift(1236).intl;
|
|
obj[3] = intl.string(importDefault(2319).g86YiI);
|
|
obj[4] = callback;
|
|
const items1 = [callback4(onSendGift(4600).Button, obj), ];
|
|
const obj1 = { grow: true, variant: "secondary", text: null, onPress: null };
|
|
const intl2 = onSendGift(1236).intl;
|
|
obj1[2] = intl2.string(importDefault(2319)["sa/cfM"]);
|
|
obj1[3] = callback1;
|
|
items1[1] = callback4(onSendGift(4600).Button, obj1);
|
|
obj[1] = items1;
|
|
return callback5(View, obj);
|
|
}
|
|
function InProgressScreen(arg0) {
|
|
let currentTier;
|
|
let description;
|
|
let nextTier;
|
|
let onSendGift;
|
|
let progress;
|
|
let progressBarTitle;
|
|
let title;
|
|
({ progress, title, progressBarTitle, description, currentTier, nextTier, onSendGift } = arg0);
|
|
const tmp = callback6(importDefault(1581)().bottom);
|
|
let obj = { style: tmp.screenContainer, children: null };
|
|
obj = { style: tmp.content, children: null };
|
|
obj = { style: tmp.progressWrapper, children: callback4(importDefault(9826), { progress, currentTier, nextTier, iconSize: 48, title: progressBarTitle }) };
|
|
const items = [callback4(View, obj), ];
|
|
const obj1 = { style: tmp.messageSection, children: null };
|
|
const items1 = [callback4(require(4185) /* Text */.Text, { variant: "heading-xxl/bold", style: tmp.centerText, children: title }), callback4(require(4185) /* Text */.Text, { variant: "text-md/medium", color: "text-subtle", style: tmp.centerText, children: description })];
|
|
obj1[1] = items1;
|
|
items[1] = callback5(View, obj1);
|
|
obj[1] = items;
|
|
const items2 = [callback5(View, obj), callback4(PostPurchaseFooter, { onSendGift })];
|
|
obj[1] = items2;
|
|
return callback5(View, obj);
|
|
}
|
|
function LevelUpScreen(arg0) {
|
|
let currentTier;
|
|
let giftsToNextTier;
|
|
let newTier;
|
|
let nextTier;
|
|
let onSendGift;
|
|
let simulatedProgress;
|
|
({ newTier, nextTier, giftsToNextTier } = arg0);
|
|
({ simulatedProgress, currentTier, onSendGift } = arg0);
|
|
const tmp3 = callback6(importDefault(1581)().bottom);
|
|
const effect = React.useEffect(() => {
|
|
const result = callback(4158).triggerHapticFeedback(callback2(4159).IMPACT_HEAVY);
|
|
}, []);
|
|
let obj = { style: tmp3.screenContainer, children: null };
|
|
obj = { style: tmp3.content, children: null };
|
|
obj = { style: tmp3.levelUpIconWrapper, children: null };
|
|
let tmp7Result = null != newTier.simple_icon_url;
|
|
if (tmp7Result) {
|
|
const obj1 = { icon: null, size: 140 };
|
|
obj1[0] = newTier.simple_icon_url;
|
|
tmp7Result = tmp7(tmp(9706), obj1);
|
|
}
|
|
obj[1] = tmp7Result;
|
|
const items = [closure_10(View, obj), ];
|
|
const obj2 = { style: tmp3.levelUpBody, children: null };
|
|
const items1 = [closure_10(importDefault(9827), { progress: simulatedProgress, currentTier, newTier, style: tmp3.levelUpProgress }), ];
|
|
const obj4 = { style: tmp3.messageSection, children: null };
|
|
const obj5 = { variant: "heading-xxl/bold", style: tmp3.centerText, children: null };
|
|
const intl = require(1236) /* getSystemLocale */.intl;
|
|
let str = newTier.name;
|
|
if (str == null) {
|
|
str = "";
|
|
}
|
|
obj5[2] = intl.format(importDefault(2319).k8MmO8, { tierName: str });
|
|
const items2 = [closure_10(require(4185) /* Text */.Text, obj5), ];
|
|
tmp7Result = null != nextTier && null != giftsToNextTier;
|
|
if (tmp7Result) {
|
|
tmp7Result = giftsToNextTier > 0;
|
|
}
|
|
if (tmp7Result) {
|
|
const obj6 = { variant: "text-md/normal", color: "text-subtle", style: null, children: null };
|
|
obj6[2] = tmp3.centerText;
|
|
const intl2 = tmp9(1236).intl;
|
|
const obj7 = { count: null, nextTierName: null };
|
|
obj7[0] = giftsToNextTier;
|
|
let str2 = nextTier.name;
|
|
if (str2 == null) {
|
|
str2 = "";
|
|
}
|
|
obj7[1] = str2;
|
|
obj6[3] = intl2.format(tmp(2319)["6QVlxw"], obj7);
|
|
tmp7Result = tmp7(tmp9(4185).Text, obj6);
|
|
}
|
|
items2[1] = tmp7Result;
|
|
obj4[1] = items2;
|
|
items1[1] = closure_11(View, obj4);
|
|
obj2[1] = items1;
|
|
items[1] = closure_11(View, obj2);
|
|
obj[1] = items;
|
|
const items3 = [closure_11(View, obj), closure_10(PostPurchaseFooter, { onSendGift })];
|
|
obj[1] = items3;
|
|
return closure_11(View, obj);
|
|
}
|
|
({ getRemainingGiftsToNextTier: closure_6, getTierForProgress: error, getNextTierForProgress: metroImportAll } = getTierForProgress);
|
|
({ jsx: c10, jsxs: unpackModuleId } = jsxProd);
|
|
let closure_12 = createCacheKey.createStyles((arg0) => {
|
|
let obj = { screenContainer: { flex: 1 }, content: null, progressWrapper: null, messageSection: null, centerText: null, levelUpIconWrapper: null, levelUpBody: null, levelUpProgress: null, footer: null };
|
|
obj = { flex: 1, alignItems: "center", justifyContent: "center", padding: importDefault(712).space.PX_16 };
|
|
obj[1] = obj;
|
|
obj = { padding: importDefault(712).space.PX_16, width: "100%", marginBottom: importDefault(712).space.PX_24 };
|
|
obj[2] = obj;
|
|
obj[3] = { gap: importDefault(712).space.PX_12, alignItems: "center", width: "100%", paddingHorizontal: importDefault(712).space.PX_16 };
|
|
obj[4] = { textAlign: "center" };
|
|
const obj1 = { gap: importDefault(712).space.PX_12, alignItems: "center", width: "100%", paddingHorizontal: importDefault(712).space.PX_16 };
|
|
obj[5] = { paddingVertical: 26, paddingHorizontal: 74, marginBottom: importDefault(712).space.PX_48 };
|
|
const obj2 = { paddingVertical: 26, paddingHorizontal: 74, marginBottom: importDefault(712).space.PX_48 };
|
|
obj[6] = { gap: importDefault(712).space.PX_12, alignItems: "center", width: "100%" };
|
|
obj[7] = { maxWidth: 260 };
|
|
const obj3 = { gap: importDefault(712).space.PX_12, alignItems: "center", width: "100%" };
|
|
obj[8] = { width: "100%", gap: importDefault(712).space.PX_12, paddingHorizontal: importDefault(712).space.PX_16, paddingBottom: importDefault(712).space.PX_16 + arg0 };
|
|
return obj;
|
|
});
|
|
let result = require("map").fileFinishedImporting("modules/premium/native/gifting/GiftBadgePostPurchase.tsx");
|
|
|
|
export default function GiftBadgePostPurchase(arg0) {
|
|
let currentProgress;
|
|
let onSendGift;
|
|
({ currentProgress, onSendGift } = arg0);
|
|
const effect = React.useEffect(() => {
|
|
let obj = callback(4005);
|
|
obj = { dismissAction: constants.INDIRECT_ACTION };
|
|
const result = obj.UNSAFE_markDismissibleContentAsDismissed(callback(1358).DismissibleContent.NEW_GIFTING_BADGES_COACHMARK, obj);
|
|
}, []);
|
|
let obj = require(589) /* initialize */;
|
|
const items = [map];
|
|
const stateFromStores = obj.useStateFromStores(items, () => {
|
|
badgeById = badgeById.getBadgeById(callback(8106).BadgeId.GIFTING);
|
|
let tiers;
|
|
if (badgeById != null) {
|
|
tiers = badgeById.tiers;
|
|
}
|
|
return tiers;
|
|
});
|
|
if (null == stateFromStores) {
|
|
return null;
|
|
} else {
|
|
const tmp24 = callback2(stateFromStores, currentProgress);
|
|
const sum = currentProgress + 1;
|
|
const tmp26 = callback2(stateFromStores, sum);
|
|
let key;
|
|
if (tmp26 != null) {
|
|
key = tmp26.key;
|
|
}
|
|
let key1;
|
|
if (tmp24 != null) {
|
|
key1 = tmp24.key;
|
|
}
|
|
const tmp8 = callback3(stateFromStores, sum);
|
|
const tmp10 = callback(stateFromStores, sum);
|
|
if (key !== key1) {
|
|
if (null != tmp26) {
|
|
obj = { simulatedProgress: null, currentTier: null, newTier: null, nextTier: null, giftsToNextTier: null, onSendGift: null };
|
|
obj[0] = sum;
|
|
obj[1] = tmp24;
|
|
obj[2] = tmp26;
|
|
obj[3] = tmp8;
|
|
obj[4] = tmp10;
|
|
obj[5] = onSendGift;
|
|
let tmp11Result = callback4(LevelUpScreen, obj);
|
|
}
|
|
return tmp11Result;
|
|
}
|
|
if (1 === tmp10) {
|
|
const intl2 = tmp2(1236).intl;
|
|
let str2;
|
|
if (tmp8 != null) {
|
|
str2 = tmp8.name;
|
|
}
|
|
if (str2 == null) {
|
|
str2 = "";
|
|
}
|
|
obj = { title: null, description: null, progressBarTitle: null, progress: null, currentTier: null, nextTier: null, onSendGift: null };
|
|
const obj1 = { nextTier: null };
|
|
obj1[0] = str2;
|
|
obj[0] = intl2.formatToPlainString(importDefault(2319).KjdBPz, obj1);
|
|
const intl3 = tmp2(1236).intl;
|
|
obj[1] = intl3.string(importDefault(2319).oqDrEM);
|
|
const intl4 = tmp2(1236).intl;
|
|
obj[2] = intl4.string(importDefault(2319)["Ka5s+Q"]);
|
|
obj[3] = sum;
|
|
obj[4] = tmp26;
|
|
obj[5] = tmp8;
|
|
obj[6] = onSendGift;
|
|
let obj2 = obj;
|
|
const tmp18 = tmp26;
|
|
const tmp19 = tmp8;
|
|
} else {
|
|
obj2 = { title: null, description: null, progressBarTitle: null, progress: null, currentTier: null, nextTier: null, onSendGift: null };
|
|
const intl5 = tmp2(1236).intl;
|
|
obj2[0] = intl5.string(importDefault(2319)["/rBQud"]);
|
|
const intl6 = tmp2(1236).intl;
|
|
obj2[1] = intl6.string(importDefault(2319).DDQMlx);
|
|
let name;
|
|
if (tmp24 != null) {
|
|
name = tmp24.name;
|
|
}
|
|
let str = "";
|
|
if (null != name) {
|
|
const intl = tmp2(1236).intl;
|
|
let name1;
|
|
if (tmp24 != null) {
|
|
name1 = tmp24.name;
|
|
}
|
|
const obj3 = { tierName: null };
|
|
obj3[0] = name1;
|
|
str = intl.formatToPlainString(tmp27(2319).bwyQt8, obj3);
|
|
}
|
|
obj2[2] = str;
|
|
obj2[3] = sum;
|
|
obj2[4] = tmp26;
|
|
obj2[5] = tmp8;
|
|
obj2[6] = onSendGift;
|
|
const tmp15 = tmp26;
|
|
const tmp16 = tmp8;
|
|
tmp27 = importDefault;
|
|
}
|
|
tmp11Result = callback4(InProgressScreen, obj2);
|
|
const tmp11 = callback4;
|
|
const tmp12 = InProgressScreen;
|
|
}
|
|
};
|