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

135 lines
6.3 KiB
TypeScript
Raw Normal View History

2026-07-25 08:10:48 +00:00
// Module ID: 9720
2026-07-27 11:26:19 +00:00
// Function ID: 75736
2026-07-20 16:05:17 +00:00
// Name: PremiumGiftDurationButton
2026-07-25 08:10:48 +00:00
// Dependencies: [31, 27, 1852, 33, 4131, 689, 8736, 5164, 7578, 9647, 3849, 4127, 1212, 8737, 5450, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-07-25 08:10:48 +00:00
// Module 9720 (PremiumGiftDurationButton)
2026-07-23 10:11:24 +00:00
import result from "result";
import { View } from "get ActivityIndicator";
import GuildFeatures from "GuildFeatures";
import jsxProd from "jsxProd";
import _createForOfIteratorHelperLoose from "_createForOfIteratorHelperLoose";
import _createForOfIteratorHelperLoose from "_createForOfIteratorHelperLoose";
2026-07-20 16:05:17 +00:00
let SubscriptionIntervalTypes;
2026-07-23 10:11:24 +00:00
let closure_5;
let closure_7;
let closure_8;
const require = arg1;
2026-07-20 16:05:17 +00:00
function PremiumGiftDurationButton(arg0) {
let accessibilityRole;
let accessibilityState;
let planInterval;
let selected;
({ selected, planInterval } = arg0);
2026-07-25 08:10:48 +00:00
let obj = planInterval(8736);
2026-07-20 16:05:17 +00:00
const nativeGiftContext = obj.useNativeGiftContext();
2026-07-23 10:11:24 +00:00
const setPlanInterval = nativeGiftContext.setPlanInterval;
const tmp2 = _createForOfIteratorHelperLoose();
2026-07-20 16:05:17 +00:00
if (selected) {
2026-07-25 08:10:48 +00:00
let RowButton = tmp3(5164).TableRow;
2026-07-20 16:05:17 +00:00
} else {
2026-07-25 08:10:48 +00:00
RowButton = tmp3(7578).RowButton;
2026-07-20 16:05:17 +00:00
}
let combined = null;
if (planInterval === SubscriptionIntervalTypes.YEAR) {
const _HermesInternal = HermesInternal;
combined = "" + closure_5 + "%";
}
2026-07-25 08:10:48 +00:00
let obj1 = planInterval(3849);
2026-07-20 16:05:17 +00:00
obj = { selected };
const radioA11yNative = obj1.useRadioA11yNative(obj);
obj = {};
const items = [tmp2.container, ];
({ accessibilityRole, accessibilityState } = radioA11yNative);
if (selected) {
selected = tmp2.containerSelected;
}
items[1] = selected;
obj.style = items;
obj1 = {};
const obj2 = { style: tmp2.labelContainer };
const obj3 = { variant: "text-md/semibold" };
if (planInterval === SubscriptionIntervalTypes.MONTH) {
2026-07-23 10:11:24 +00:00
const intl2 = planInterval(1212).intl;
let stringResult = intl2.string(planInterval(1212).t.Mh9bTt);
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
const intl = planInterval(1212).intl;
stringResult = intl.string(planInterval(1212).t.DRgqMo);
2026-07-20 16:05:17 +00:00
}
obj3.children = stringResult;
2026-07-25 08:10:48 +00:00
const items1 = [callback(planInterval(4127).Text, obj3), ];
2026-07-20 16:05:17 +00:00
let tmp21 = null != combined;
if (tmp21) {
const obj4 = { style: tmp2.labelPromo };
2026-07-23 10:11:24 +00:00
const obj5 = { variant: "text-md/bold", color: "text-overlay-light" };
const intl3 = planInterval(1212).intl;
2026-07-20 16:05:17 +00:00
const obj6 = { discount: combined };
2026-07-23 10:11:24 +00:00
obj5.children = intl3.formatToPlainString(planInterval(1212).t.IAybsG, obj6).toUpperCase();
2026-07-25 08:10:48 +00:00
obj4.children = callback(planInterval(4127).Text, obj5);
2026-07-20 16:05:17 +00:00
tmp21 = callback(View, obj4);
2026-07-23 10:11:24 +00:00
const str3 = intl3.formatToPlainString(planInterval(1212).t.IAybsG, obj6);
2026-07-20 16:05:17 +00:00
}
items1[1] = tmp21;
obj2.children = items1;
obj1.label = closure_8(View, obj2);
2026-07-25 08:10:48 +00:00
obj1.trailing = callback(planInterval(4127).Text, { variant: "text-md/semibold", children: setPlanInterval(9647)(nativeGiftContext.premiumType, planInterval) });
2026-07-20 16:05:17 +00:00
obj1.onPress = function onPress() {
setPlanInterval(planInterval);
};
obj1.arrow = false;
obj1.accessibilityRole = accessibilityRole;
obj1.accessibilityState = accessibilityState;
obj1.start = true;
obj1.end = true;
obj.children = callback(RowButton, obj1);
return callback(View, obj);
}
2026-07-23 10:11:24 +00:00
({ PREMIUM_YEARLY_DISCOUNT_PERCENT: closure_5, SubscriptionIntervalTypes } = GuildFeatures);
({ jsx: closure_7, jsxs: closure_8 } = jsxProd);
let items = [, ];
2026-07-20 16:05:17 +00:00
({ YEAR: arr[0], MONTH: arr[1] } = SubscriptionIntervalTypes);
2026-07-23 10:11:24 +00:00
_createForOfIteratorHelperLoose = {};
_createForOfIteratorHelperLoose = { marginTop: require("_createForOfIteratorHelperLoose").space.PX_8 };
_createForOfIteratorHelperLoose.container = _createForOfIteratorHelperLoose;
_createForOfIteratorHelperLoose.containerSelected = { borderColor: require("_createForOfIteratorHelperLoose").colors.BACKGROUND_BRAND, borderRadius: require("_createForOfIteratorHelperLoose").radii.lg, borderWidth: 2 };
_createForOfIteratorHelperLoose.labelContainer = { flexDirection: "row" };
let obj1 = { borderColor: require("_createForOfIteratorHelperLoose").colors.BACKGROUND_BRAND, borderRadius: require("_createForOfIteratorHelperLoose").radii.lg, borderWidth: 2 };
_createForOfIteratorHelperLoose.labelPromo = { marginStart: require("_createForOfIteratorHelperLoose").space.PX_8, backgroundColor: require("_createForOfIteratorHelperLoose").colors.STATUS_POSITIVE_BACKGROUND, paddingHorizontal: require("_createForOfIteratorHelperLoose").space.PX_8, borderRadius: require("_createForOfIteratorHelperLoose").radii.round };
_createForOfIteratorHelperLoose = _createForOfIteratorHelperLoose.createStyles(_createForOfIteratorHelperLoose);
let obj3 = {};
let obj2 = { marginStart: require("_createForOfIteratorHelperLoose").space.PX_8, backgroundColor: require("_createForOfIteratorHelperLoose").colors.STATUS_POSITIVE_BACKGROUND, paddingHorizontal: require("_createForOfIteratorHelperLoose").space.PX_8, borderRadius: require("_createForOfIteratorHelperLoose").radii.round };
obj3.durationContainer = { marginHorizontal: require("_createForOfIteratorHelperLoose").space.PX_16 };
_createForOfIteratorHelperLoose = { marginTop: require("_createForOfIteratorHelperLoose").space.PX_24 };
obj3.durationTitle = _createForOfIteratorHelperLoose;
let closure_11 = _createForOfIteratorHelperLoose.createStyles(obj3);
let obj4 = { marginHorizontal: require("_createForOfIteratorHelperLoose").space.PX_16 };
const result = require("GuildFeatures").fileFinishedImporting("modules/premium/native/gifting/PremiumGiftDuration.tsx");
2026-07-20 16:05:17 +00:00
export default function PremiumGiftDuration() {
2026-07-23 10:11:24 +00:00
const tmp = callback3();
2026-07-25 08:10:48 +00:00
let obj = planInterval(8736);
2026-07-23 10:11:24 +00:00
planInterval = obj.useNativeGiftContext().planInterval;
2026-07-25 08:10:48 +00:00
const tmp2 = importDefault(5450)(importDefault(8737).useConfig({ location: "PremiumGiftDuration" }).monthlyDefaultSelected);
2026-07-23 10:11:24 +00:00
importDefault = tmp2;
let items = [tmp2];
2026-07-20 16:05:17 +00:00
const memo = React.useMemo(() => {
2026-07-23 10:11:24 +00:00
if (closure_1) {
2026-07-20 16:05:17 +00:00
const items = [];
HermesBuiltin.arraySpread(tmp, 0);
let reversed = items.reverse();
} else {
reversed = tmp;
}
return reversed;
}, items);
obj = { style: tmp.durationContainer };
obj = { style: tmp.durationTitle, variant: "text-sm/semibold" };
2026-07-23 10:11:24 +00:00
const intl = planInterval(1212).intl;
obj.children = intl.string(planInterval(1212).t["8XT6Nf"]);
2026-07-25 08:10:48 +00:00
const items1 = [callback(planInterval(4127).Text, obj), memo.map((planInterval) => outer1_7(outer1_12, { selected: planInterval === planInterval, planInterval }, arg1))];
2026-07-20 16:05:17 +00:00
obj.children = items1;
return callback2(View, obj);
};