decord/source/components_native/premium/GiftCodeRow.tsx

126 lines
6.1 KiB
TypeScript
Raw Normal View History

2026-09-01 10:26:29 +00:00
// Module ID: 13220
// Function ID: 13221
2026-07-29 08:29:29 +00:00
// Name: handleRevoke
2026-09-01 10:26:29 +00:00
// Dependencies: [19, 17, 676, 21, 4478, 712, 4204, 8477, 4752, 8632, 6229, 4474, 4928, 1236, 4075, 1297, 2]
2026-07-20 16:05:17 +00:00
2026-09-01 10:26:29 +00:00
// Module 13220 (handleRevoke)
2026-08-24 06:08:38 +00:00
import ThemesDefault from "Themes" /* 712 */;
2026-09-01 10:26:29 +00:00
import resolveGiftCodeDefault from "resolveGiftCode" /* 8477 */;
2026-08-24 06:08:38 +00:00
import get_ActivityIndicator from "get ActivityIndicator" /* 17 */;
import { AnalyticsSections } from "ME" /* 676 */;
import jsxProd from "jsxProd" /* 21 */;
2026-09-01 10:26:29 +00:00
import createCacheKey from "createCacheKey" /* 4478 */;
2026-08-24 06:08:38 +00:00
import importAllResult from "noop" /* 19 */;
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
let require = arg1;
({ View: c3, TouchableWithoutFeedback: c4, StyleSheet } = get_ActivityIndicator);
({ jsx: closure_6, jsxs: error } = jsxProd);
createCacheKey = { giftCodeRow: { paddingHorizontal: 16 }, giftCodeRowLegacy: null, giftCodeShare: null, giftCodeInput: null, giftCodeInputContent: null, giftCodeShareButton: null, codeText: null, subTextRow: null, expiryText: null, revokeHint: null, firstRow: null, buttonContainer: null };
2026-08-24 06:08:38 +00:00
createCacheKey = { backgroundColor: ThemesDefault.colors.BACKGROUND_SURFACE_HIGH };
2026-07-29 08:29:29 +00:00
createCacheKey[1] = createCacheKey;
2026-08-24 06:08:38 +00:00
createCacheKey[2] = { flexDirection: "row", alignItems: "center", justifyContent: "space-between", marginVertical: 8, padding: 8, borderRadius: ThemesDefault.radii.xs, borderWidth: StyleSheet.hairlineWidth, backgroundColor: ThemesDefault.colors.INPUT_BACKGROUND_DEFAULT };
let obj1 = { flexDirection: "row", alignItems: "center", justifyContent: "space-between", marginVertical: 8, padding: 8, borderRadius: ThemesDefault.radii.xs, borderWidth: StyleSheet.hairlineWidth, backgroundColor: ThemesDefault.colors.INPUT_BACKGROUND_DEFAULT };
createCacheKey[3] = { marginTop: ThemesDefault.space.PX_16, marginBottom: ThemesDefault.space.PX_4 };
let obj2 = { marginTop: ThemesDefault.space.PX_16, marginBottom: ThemesDefault.space.PX_4 };
createCacheKey[4] = { flexDirection: "row", alignItems: "center", justifyContent: "space-between", padding: ThemesDefault.space.PX_8 };
2026-07-29 08:29:29 +00:00
createCacheKey[5] = { marginLeft: 12 };
createCacheKey[6] = { flexShrink: 1 };
createCacheKey[7] = { marginBottom: 8, flexDirection: "row", alignItems: "center" };
createCacheKey[8] = { fontSize: 12, lineHeight: 16 };
2026-08-24 06:08:38 +00:00
let obj3 = { flexDirection: "row", alignItems: "center", justifyContent: "space-between", padding: ThemesDefault.space.PX_8 };
createCacheKey[9] = { color: ThemesDefault.unsafe_rawColors.BLUE_345 };
2026-07-29 08:29:29 +00:00
createCacheKey[10] = { borderWidth: 0 };
createCacheKey[11] = { flexShrink: 0, flexGrow: 1 };
2026-08-24 06:08:38 +00:00
let closure_8 = createCacheKey.createLegacyClassComponentStyles(createCacheKey);
2026-07-29 08:29:29 +00:00
const PureComponent = importAllResult.PureComponent;
class GiftCodeRow extends PureComponent {
constructor() {
applyArgumentsResult = HermesBuiltin.applyArguments(new.target, new.target);
closure_0 = applyArgumentsResult;
applyArgumentsResult.handleShare = function handleShare() {
({ giftCode, sku } = applyArgumentsResult.props);
if (tmp) {
2026-08-24 06:08:38 +00:00
let obj = applyArgumentsResult(closure_1_2[8]);
2026-07-29 08:29:29 +00:00
obj.trackGiftCodeCopy(giftCode, sku);
obj = { url: null };
2026-08-24 06:08:38 +00:00
const obj2 = applyArgumentsResult(closure_1_2[9]);
obj[0] = applyArgumentsResult(closure_1_2[8]).getGiftCodeURL(giftCode.code);
obj2.showShareActionSheet(obj, closure_1_5.GIFT_CODE_ROW);
const obj4 = applyArgumentsResult(closure_1_2[8]);
2026-07-29 08:29:29 +00:00
}
};
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
const prototype = GiftCodeRow.prototype;
prototype["handleRevoke"] = function handleRevoke(code) {
2026-08-24 06:08:38 +00:00
resolveGiftCodeDefault.revokeGiftCode(code);
2026-07-29 08:29:29 +00:00
};
prototype["render"] = function render() {
2026-08-31 15:47:37 +00:00
const self = this;
2026-08-24 06:08:38 +00:00
const tmp = callback2(this.context);
importDefault = tmp;
2026-07-29 08:29:29 +00:00
const props = this.props;
const giftCode = props.giftCode;
2026-08-31 15:47:37 +00:00
let items = [tmp.giftCodeRow, ];
2026-07-29 08:29:29 +00:00
let firstRow = null;
if (props.isFirst) {
firstRow = tmp.firstRow;
}
let obj = { style: items, children: null };
2026-08-31 15:47:37 +00:00
items[1] = firstRow;
obj = { style: tmp.giftCodeInput, children: null };
obj = { children: null };
obj1 = { style: tmp.giftCodeInputContent, children: null };
const obj2 = { variant: "text-sm/normal", style: tmp.codeText, lineClamp: 1, children: null };
let obj5 = giftCode(self[8]);
obj2[3] = obj5.getGiftCodeURL(giftCode.code);
const items1 = [callback(giftCode(self[11]).Text, obj2), ];
const obj3 = { style: items2, children: null };
items2 = [, ];
({ buttonContainer: arr3[0], giftCodeShareButton: arr3[1] } = tmp);
const obj4 = { size: "sm", text: null, onPress: null };
const intl = giftCode(self[13]).intl;
obj4[1] = intl.string(giftCode(self[13]).t.h5EvZM);
obj4[2] = this.handleShare;
obj3[1] = callback(giftCode(self[12]).Button, obj4);
items1[1] = callback(closure_3, obj3);
obj1[1] = items1;
obj[0] = closure_7(closure_3, obj1);
obj[1] = callback(giftCode(self[10]).InputFieldContainer, obj);
const items3 = [callback(closure_3, obj), ];
obj5 = { style: tmp.subTextRow, children: null };
let tmp5Result = null;
2026-07-29 08:29:29 +00:00
if (null != giftCode.expiresAt) {
2026-08-31 15:47:37 +00:00
const obj6 = { variant: "text-xs/normal", color: "text-subtle", children: null };
const intl2 = tmp6(tmp7[13]).intl;
const obj7 = { hours: null, revokeHook: null };
2026-07-29 08:29:29 +00:00
const expiresAt = giftCode.expiresAt;
2026-08-31 15:47:37 +00:00
obj7[0] = expiresAt.diff(importDefault(tmp7[14])(), "h");
obj7[1] = function revokeHook(children) {
2026-07-29 08:29:29 +00:00
obj = {
accessibilityRole: "button",
onPress() {
return closure_2.handleRevoke(code.code);
},
2026-08-24 06:08:38 +00:00
children: closure_1_6(giftCode(self[15]).LegacyText, obj)
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
obj = { style: items, children };
items = [, ];
({ expiryText: arr[0], revokeHint: arr[1] } = closure_1);
2026-08-24 06:08:38 +00:00
return closure_1_6(closure_1_4, obj, arg1);
2026-07-29 08:29:29 +00:00
};
2026-08-31 15:47:37 +00:00
obj6[2] = intl2.format(tmp6(tmp7[13]).t.b1BfWD, obj7);
tmp5Result = tmp5(tmp6(tmp7[11]).Text, obj6);
2026-07-20 16:05:17 +00:00
}
2026-08-31 15:47:37 +00:00
obj5[1] = tmp5Result;
items3[1] = callback(closure_3, obj5);
obj[1] = items3;
2026-07-29 08:29:29 +00:00
return closure_7(closure_3, obj);
};
GiftCodeRow.contextType = require("ManaContext").ThemeContext;
2026-08-24 06:08:38 +00:00
let obj4 = { color: ThemesDefault.unsafe_rawColors.BLUE_345 };
const result = require("set").fileFinishedImporting("components_native/premium/GiftCodeRow.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default GiftCodeRow;