154 lines
9.5 KiB
TypeScript
154 lines
9.5 KiB
TypeScript
/* Metro module 10465; source: modules/premium/native/gifting/PremiumGiftPurchaseSuccess.tsx; dependencies: [31, 27, 4279, 1880, 661, 33, 4501, 697, 7669, 1484, 7633, 4129, 10382, 9212, 4578, 1244, 3802, 6797, 3856, 7642, 4573, 8554, 4061, 2] */
|
|
function _fun80988(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#80988, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10651:6, offset: 0x01e93720, size: 473 bytes, params: 8, frame: 23
|
|
var object3;
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importAll(31) /* metro dependency 31 */;
|
|
const env0_4 = (require(27) /* metro dependency 27 */).View;
|
|
const skuStore = importDefault(4279) /* metro dependency 4279: SKUStore */;
|
|
const env0_6 = (require(1880) /* metro dependency 1880: PremiumConstants */).SubscriptionIntervalTypes;
|
|
const env0_7 = (require(661) /* metro dependency 661: Constants */).AnalyticsSections;
|
|
let value = require(33) /* metro dependency 33 */;
|
|
const env0_8 = value.jsx;
|
|
const env0_9 = value.Fragment;
|
|
const env0_10 = value.jsxs;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object3 = {};
|
|
const object4 = {};
|
|
let PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
|
|
object4.marginTop = PX_4;
|
|
const PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object4.marginBottom = PX_16;
|
|
object3.disclaimer = object4;
|
|
let PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
|
|
object3.title = {marginTop: PX_24, textAlign: 'center'};
|
|
const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object3.description = {marginTop: PX_8, textAlign: 'center'};
|
|
PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
|
|
object3.input = {marginTop: PX_24};
|
|
PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
|
|
object3.inputLabel = {marginBottom: PX_4};
|
|
const env0_11 = Reflect.apply(createStyles, value, [object3]);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/native/gifting/PremiumGiftPurchaseSuccess.tsx');
|
|
exports.default = PremiumGiftSuccessBody;
|
|
exports.PremiumGiftSuccessActions = PremiumGiftSuccessActions;
|
|
}
|
|
|
|
function PremiumGiftSuccessBody({giftCodeRecord}) { // fn#80989, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10651:644, offset: 0x01e938f9, size: 916 bytes, params: 2, frame: 31
|
|
const styles = useStyles();
|
|
let {premiumType, planInterval,
|
|
giftStyle} = (require(7669) /* metro dependency 7669: NativeGiftContext */).useNativeGiftContext();
|
|
const giftCodeURL = (require(4129) /* metro dependency 4129: GiftCodeUtils */).getGiftCodeURL(giftCodeRecord.code);
|
|
giftStyle = giftCodeRecord.giftStyle ?? giftStyle;
|
|
const r4 = giftCodeRecord.subscriptionPlanId ?? (require(3802) /* metro dependency 3802: PremiumUtils */).getPlanIdForPremiumType(premiumType,
|
|
planInterval);
|
|
const tierDisplayNameByPlanId = (importDefault(3802) /* metro dependency 3802: PremiumUtils */).getTierDisplayNameByPlanId(r4);
|
|
const defaultImport2 = importDefault(3802) /* metro dependency 3802: PremiumUtils */;
|
|
const getInterval = defaultImport2.getInterval;
|
|
const intervalType = Reflect.apply(getInterval, defaultImport2, [r4]).intervalType;
|
|
const YEAR = SubscriptionIntervalTypes.YEAR;
|
|
const value6 = env0_3.useCallback(_fun80990, [giftCodeRecord, giftCodeURL]);
|
|
const jsxRuntimeEnv0_9Binding = jsxRuntimeEnv0_9;
|
|
const items2 = [<View>{((Component) => <Component giftStyle={giftStyle} />)(importDefault(7642) /* metro dependency 7642: PremiumGiftBackgroundAnimationAndroid */)}</View>];
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
let string = intl.string;
|
|
items2[1] = <Text style={styles.title} variant="heading-lg/bold">{Reflect.apply(string, intl,
|
|
[(require(1244) /* metro dependency 1244: indexNative */).t['/s1xR7']])}</Text>;
|
|
items2[2] = <Text style={styles.description} variant="text-md/medium">{intl.format(intervalType === YEAR ? (require(1244) /* metro dependency 1244: indexNative */).t.rli5ey : (require(1244) /* metro dependency 1244: indexNative */).t.bUdTqI,
|
|
{intervalCount: 1, name: tierDisplayNameByPlanId})}</Text>;
|
|
const text = <Text style={styles.inputLabel} variant="heading-md/bold">{intl.string((require(1244) /* metro dependency 1244: indexNative */).t['qS+yMo'])}</Text>;
|
|
const InputButton = (require(8554) /* metro dependency 8554: native */).InputButton;
|
|
items2[3] = <View style={styles.input}>{text}<InputButton text={giftCodeURL} icon={importDefault(4061) /* metro dependency 4061 */} iconPosition="end" onPress={value6} /></View>;
|
|
string = intl.string;
|
|
const As9eLl = (require(1244) /* metro dependency 1244: indexNative */).t.As9eLl;
|
|
items2[4] = <Text style={styles.disclaimer} variant="text-xs/normal">{Reflect.apply(string, intl, [As9eLl])}</Text>;
|
|
return (
|
|
<>
|
|
{items2}
|
|
</>
|
|
);
|
|
}
|
|
|
|
function PremiumGiftSuccessActions({giftCodeRecord}) { // fn#80991, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10651:1878, offset: 0x01e93d13, size: 460 bytes, params: 2, frame: 25
|
|
const {onClose,
|
|
prePurchaseGiftingBadgeProgress} = (require(7669) /* metro dependency 7669: NativeGiftContext */).useNativeGiftContext();
|
|
const value3 = (require(1484) /* metro dependency 1484: useNavigationNative */).useNavigation();
|
|
const GiftingBadgeExperiment = (require(7633) /* metro dependency 7633: GiftingBadgeExperiment */).GiftingBadgeExperiment;
|
|
const useConfig = GiftingBadgeExperiment.useConfig;
|
|
const enabled = Reflect.apply(useConfig, GiftingBadgeExperiment, [{location: 'PremiumGiftSuccessActions'}]).enabled;
|
|
const env0_3 = enabled;
|
|
const giftCodeURL = (require(4129) /* metro dependency 4129: GiftCodeUtils */).getGiftCodeURL(giftCodeRecord.code);
|
|
const binding = env0_3;
|
|
const value5 = binding.useCallback(_fun80992, [enabled, prePurchaseGiftingBadgeProgress, value3, onClose]);
|
|
const value6 = binding.useCallback(_fun80993, [giftCodeURL, enabled, prePurchaseGiftingBadgeProgress, value3]);
|
|
const jsxRuntimeEnv0_9Binding = jsxRuntimeEnv0_9;
|
|
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const string = intl.string;
|
|
const RDE0Sc = (require(1244) /* metro dependency 1244: indexNative */).t.RDE0Sc;
|
|
return (
|
|
<>
|
|
<Button
|
|
variant="primary"
|
|
text={Reflect.apply(string, intl, [RDE0Sc])}
|
|
onPress={value6}
|
|
/>
|
|
<Button
|
|
variant="secondary"
|
|
text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.cpT0Cq)}
|
|
onPress={value5}
|
|
/>
|
|
</>
|
|
);
|
|
}
|
|
|
|
function _fun80990() { // fn#80990, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10651:1048, offset: 0x01e93c8d, size: 134 bytes, params: 1, frame: 15
|
|
var moduleValue;
|
|
const value = environment.__proto__;
|
|
const value3 = SKUStore.get(giftCodeRecord.skuId);
|
|
if (value3 != null) {
|
|
moduleValue = require(4129) /* metro dependency 4129: GiftCodeUtils */;
|
|
moduleValue.trackGiftCodeCopy(giftCodeRecord, value3);
|
|
}
|
|
(require(6797) /* metro dependency 6797: ClipboardUtilsNative */).copy(env0_1);
|
|
(require(3856) /* metro dependency 3856: ToastUtils */).presentCopiedToClipboard();
|
|
}
|
|
|
|
function _fun80992() { // fn#80992, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10651:2187, offset: 0x01e93edf, size: 100 bytes, params: 1, frame: 15
|
|
var binding;
|
|
var navigate;
|
|
var value2;
|
|
if (enabled) {
|
|
if (prePurchaseGiftingBadgeProgress != null) {
|
|
binding = env0_2;
|
|
navigate = binding.navigate;
|
|
value2 = environment.__proto__;
|
|
Reflect.apply(navigate, binding,
|
|
[(require(10382) /* metro dependency 10382: PremiumGiftModal */).PremiumGiftScreens.GIFTING_BADGE,
|
|
{currentProgress: prePurchaseGiftingBadgeProgress}]);
|
|
} else {
|
|
onClose();
|
|
}
|
|
} else {
|
|
onClose();
|
|
}
|
|
}
|
|
|
|
function _fun80993() { // fn#80993, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10651:2311, offset: 0x01e93f43, size: 141 bytes, params: 1, frame: 16
|
|
var binding;
|
|
const showShareActionSheetAndroidModule = require(9212) /* metro dependency 9212: showShareActionSheetAndroid */;
|
|
const showShareActionSheet = showShareActionSheetAndroidModule.showShareActionSheet;
|
|
const PREMIUM_GIFT_SUCCESS_MODAL = AnalyticsSections.PREMIUM_GIFT_SUCCESS_MODAL;
|
|
Reflect.apply(showShareActionSheet, showShareActionSheetAndroidModule, [{url: env0_4}, PREMIUM_GIFT_SUCCESS_MODAL]);
|
|
if (enabled && prePurchaseGiftingBadgeProgress != null) {
|
|
binding = env0_2;
|
|
binding.navigate((require(10382) /* metro dependency 10382: PremiumGiftModal */).PremiumGiftScreens.GIFTING_BADGE,
|
|
|
|
{currentProgress: prePurchaseGiftingBadgeProgress});
|
|
}
|
|
}
|
|
|