69 lines
3 KiB
TypeScript
69 lines
3 KiB
TypeScript
// Module ID: 14748
|
|
// Function ID: 14749
|
|
// Name: getGiftRowDisplayInfo
|
|
// Dependencies: [1233, 3717, 6090, 2368, 2]
|
|
// Exports: formatGiftDate, getGiftRowDisplayInfo, getGiftSubtext
|
|
|
|
// Module 14748 (getGiftRowDisplayInfo)
|
|
import set from "set" /* 2 */;
|
|
import getSystemLocale from "getSystemLocale" /* 1233 */;
|
|
import messagesProxyDefault from "messagesProxy" /* 2368 */;
|
|
import _mod3717 from "module_3717" /* 3717 */;
|
|
import formatSingleCurrencyPrice from "formatSingleCurrencyPrice" /* 6090 */;
|
|
|
|
const result = set.fileFinishedImporting("modules/parent_tools/FamilyCenterActivityGiftRowUtils.tsx");
|
|
|
|
export const getGiftRowDisplayInfo = function getGiftRowDisplayInfo(giftInfo) {
|
|
return { skuId: giftInfo.sku_id, subscriptionPlanId: giftInfo.subscription_plan_id, price: giftInfo.price, gifterUserId: giftInfo.gifter_user_id, claimed: giftInfo.claimed, offeredAt: giftInfo.offered_at, claimedAt: giftInfo.claimed_at };
|
|
};
|
|
export const formatGiftDate = function formatGiftDate(claimedAt) {
|
|
const dateTimeFormat = new Intl.DateTimeFormat(getSystemLocale.intl.currentLocale, { month: "short", day: "numeric" });
|
|
return dateTimeFormat.format(_mod3717.parseISO(claimedAt));
|
|
};
|
|
export const getGiftSubtext = function getGiftSubtext(claimed) {
|
|
({ price, gifterName, offeredAt, claimedAt } = claimed);
|
|
let formatPriceResult = null;
|
|
if (null != price) {
|
|
let obj = formatSingleCurrencyPrice;
|
|
formatPriceResult = obj.formatPrice(price.amount, price.currency);
|
|
}
|
|
if (null != formatPriceResult) {
|
|
if (null != gifterName) {
|
|
const intl = getSystemLocale.intl;
|
|
obj = { price: null, username: null };
|
|
obj[0] = formatPriceResult;
|
|
obj[1] = gifterName;
|
|
let formatToPlainStringResult = intl.formatToPlainString(messagesProxyDefault["o44n/1"], obj);
|
|
}
|
|
const items = [formatToPlainStringResult, ];
|
|
const intl2 = getSystemLocale.intl;
|
|
const formatToPlainString = intl2.formatToPlainString;
|
|
const tmp11 = messagesProxyDefault;
|
|
if (claimed.claimed) {
|
|
if (claimedAt == null) {
|
|
claimedAt = offeredAt;
|
|
}
|
|
obj = { date: null };
|
|
const _Intl2 = Intl;
|
|
const dateTimeFormat = new Intl.DateTimeFormat(tmp8(1233).intl.currentLocale, { month: "short", day: "numeric" });
|
|
let tmp8Result = tmp8(3717);
|
|
obj[0] = dateTimeFormat.format(tmp8Result.parseISO(claimedAt));
|
|
let formatToPlainStringResult1 = formatToPlainString(tmp11.kDyllq, obj);
|
|
} else {
|
|
obj1 = { date: null };
|
|
const _Intl = Intl;
|
|
const dateTimeFormat1 = new Intl.DateTimeFormat(tmp8(1233).intl.currentLocale, { month: "short", day: "numeric" });
|
|
tmp8Result = tmp8(3717);
|
|
obj1[0] = dateTimeFormat1.format(tmp8Result.parseISO(offeredAt));
|
|
formatToPlainStringResult1 = formatToPlainString(tmp11.gAG45y, obj1);
|
|
}
|
|
items[1] = formatToPlainStringResult1;
|
|
const _Boolean = Boolean;
|
|
const found = items.filter(Boolean);
|
|
return found.join(" \u2022 ");
|
|
}
|
|
formatToPlainStringResult = null;
|
|
if (null != formatPriceResult) {
|
|
formatToPlainStringResult = formatPriceResult;
|
|
}
|
|
};
|