58 lines
3.9 KiB
TypeScript
58 lines
3.9 KiB
TypeScript
/* Metro module 12295; source: modules/premium/native/renderPremiumButtonText.tsx; dependencies: [31, 27, 1880, 33, 4501, 4000, 697, 3802, 1244, 1305, 2] */
|
|
function _fun93906(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#93906, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12481:6, offset: 0x020c9d33, size: 336 bytes, params: 8, frame: 23
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
importAll(31) /* metro dependency 31 */;
|
|
const env0_3 = (require(27) /* metro dependency 27 */).View;
|
|
let value = require(1880) /* metro dependency 1880: PremiumConstants */;
|
|
const env0_4 = value.PREMIUM_YEARLY_DISCOUNT_PERCENT;
|
|
const env0_5 = value.SubscriptionIntervalTypes;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_6 = value.jsx;
|
|
const env0_7 = value.jsxs;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
const colorUtilsModule = require(4000) /* metro dependency 4000: ColorUtils */;
|
|
const hexWithOpacity = colorUtilsModule.hexWithOpacity;
|
|
const WHITE = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.WHITE;
|
|
const env0_8 = Reflect.apply(createStyles, value, [{discount: {'borderWidth': 1, 'borderColor': null,
|
|
'borderRadius': 2, 'marginLeft': 4, 'paddingHorizontal': 2, borderColor: Reflect.apply(hexWithOpacity,
|
|
colorUtilsModule, [WHITE, 0.3])}, premiumText: {flexDirection: 'row'}}]);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/native/renderPremiumButtonText.tsx');
|
|
exports.default = renderPremiumText;
|
|
}
|
|
|
|
function PremiumText({style, isCurrentPlan, isGift, basePlanId, product, text}) { // fn#93907, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12481:425, offset: 0x020c9e83, size: 719 bytes, params: 2, frame: 31
|
|
const LegacyText = (require(1305) /* metro dependency 1305: native */).LegacyText;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
const styles = useStyles();
|
|
const defaultImport = importDefault(3802) /* metro dependency 3802: PremiumUtils */;
|
|
const getInterval = defaultImport.getInterval;
|
|
const intervalType = Reflect.apply(getInterval, defaultImport, [basePlanId]).intervalType;
|
|
const YEAR = SubscriptionIntervalTypes.YEAR;
|
|
const r12 = intervalType !== YEAR || isCurrentPlan ? null : '-' + PREMIUM_YEARLY_DISCOUNT_PERCENT + '%';
|
|
const r8 = text ?? (intervalType === SubscriptionIntervalTypes.MONTH ? isGift ? intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t.FIjgMp,
|
|
{price: product?.priceString ?? '$...'}) : intl.formatToPlainString(isCurrentPlan ? t.V6iX43 : t.AbOLNu,
|
|
{price: product?.priceString ?? '$...'}) : isGift ? intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t.rm53bV,
|
|
{price: product?.priceString ?? '$...'}) : intl.formatToPlainString(isCurrentPlan ? t.dFbQCa : t['rS8FA+'],
|
|
{price: product?.priceString ?? '$...'}));
|
|
const formatToPlainString = intl.formatToPlainString;
|
|
const E0lS2r = (require(1244) /* metro dependency 1244: indexNative */).t.E0lS2r;
|
|
return (
|
|
<View style={styles.premiumText}>
|
|
<LegacyText
|
|
style={style}
|
|
numberOfLines={1}
|
|
accessibilityLabel={Reflect.apply(formatToPlainString, intl, [E0lS2r, {product: product?.title,
|
|
description: r8}])}
|
|
>
|
|
{r8}
|
|
</LegacyText>
|
|
{r12 != null ? <View style={styles.discount}><LegacyText style={style} numberOfLines={1}>{r12}</LegacyText></View> : null}
|
|
</View>
|
|
);
|
|
}
|
|
|