138 lines
8.3 KiB
TypeScript
138 lines
8.3 KiB
TypeScript
/* Metro module 12266; source: components_native/premium/PremiumSubscriptionUpsell.tsx; dependencies: [31, 27, 1949, 1878, 661, 7047, 1880, 33, 4501, 697, 4064, 1244, 1856, 566, 3802, 4589, 676, 4573, 12267, 12268, 7971, 4578, 2] */
|
|
function _fun93740(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#93740, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12452:6, offset: 0x020c16f1, size: 692 bytes, params: 8, frame: 26
|
|
var object2;
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
importAll(31) /* metro dependency 31 */;
|
|
let value = require(27) /* metro dependency 27 */;
|
|
const env0_3 = value.View;
|
|
const env0_4 = value.Image;
|
|
const StyleSheet = value.StyleSheet;
|
|
const localeStore = importDefault(1949) /* metro dependency 1949: LocaleStore */;
|
|
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
|
|
const Fonts = (require(661) /* metro dependency 661: Constants */).Fonts;
|
|
const env0_7 = (require(7047) /* metro dependency 7047: ColorConstants */).Gradients;
|
|
value = require(1880) /* metro dependency 1880: PremiumConstants */;
|
|
const env0_8 = value.NUM_FREE_GUILD_BOOSTS_WITH_PREMIUM;
|
|
const env0_9 = value.GUILD_BOOST_COST_FOR_PREMIUM_USER_DISCOUNT_PERCENT;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_10 = value.jsx;
|
|
const env0_11 = value.Fragment;
|
|
const env0_12 = value.jsxs;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object2 = {};
|
|
object2.title = {textAlign: 'center'};
|
|
object2.subtitle = {'lineHeight': 20, 'marginTop': 8, 'textAlign': 'center'};
|
|
const object6 = {paddingTop: 32};
|
|
object6.borderTopWidth = 2 * StyleSheet.hairlineWidth;
|
|
let BORDER_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_SUBTLE;
|
|
object6.borderTopColor = BORDER_SUBTLE;
|
|
object2.upsell = object6;
|
|
const object7 = {'borderRadius': null, 'padding': 16, 'alignItems': 'center'};
|
|
object7.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xs;
|
|
object2.upsellCard = object7;
|
|
const object8 = {'borderRadius': null, 'padding': 16, 'marginTop': 12, 'alignSelf': 'stretch'};
|
|
object8.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
|
|
BORDER_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_SUBTLE;
|
|
object8.backgroundColor = BORDER_SUBTLE;
|
|
object2.upsellFeatures = object8;
|
|
object2.upsellFeatureSubLogo = {'alignSelf': 'center', 'height': 10, 'width': 54};
|
|
object2.upsellFeatureList = {marginTop: 8};
|
|
object2.upsellButton = {marginTop: 16};
|
|
object2.upsellFeatureLogoTier2 = {'alignSelf': 'center', 'height': 20, 'marginTop': 6, 'width': 84};
|
|
let WHITE = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.WHITE;
|
|
const PRIMARY_SEMIBOLD = Fonts.PRIMARY_SEMIBOLD;
|
|
object2.upsellLabel = {color: WHITE, fontFamily: PRIMARY_SEMIBOLD, fontSize: 16, lineHeight: 20};
|
|
WHITE = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.WHITE;
|
|
object2.upsellRow = {'paddingVertical': 0, 'marginTop': 8, color: WHITE};
|
|
const env0_13 = Reflect.apply(createStyles, value, [object2]);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('components_native/premium/PremiumSubscriptionUpsell.tsx');
|
|
exports.default = PremiumSubscriptionUpsell;
|
|
}
|
|
|
|
function PremiumSubscriptionUpsell({onLearnMorePremium, style}) { // fn#93741, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12452:1155, offset: 0x020c19a5, size: 1263 bytes, params: 2, frame: 43
|
|
var r9;
|
|
var r0;
|
|
var defaultImport2;
|
|
const HorizontalGradient = (require(676) /* metro dependency 676: ConstantsIOS */).HorizontalGradient;
|
|
var defaultImport3;
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
var jsxRuntimeEnv0_11Binding;
|
|
var items2;
|
|
var items3;
|
|
var items4;
|
|
var PremiumFeatureList;
|
|
var object;
|
|
const CheckmarkLargeIcon = (require(4064) /* metro dependency 4064: CheckmarkLargeIcon */).CheckmarkLargeIcon;
|
|
var formatToPlainString;
|
|
var P3aEj6;
|
|
var moduleValue2;
|
|
var unsafe_rawColors;
|
|
var WHITE;
|
|
var items5;
|
|
var object2;
|
|
const styles = useStyles();
|
|
const currentUser = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
|
|
return UserStore.getCurrentUser();
|
|
});
|
|
if ((importDefault(3802) /* metro dependency 3802: PremiumUtils */).canUsePremiumGuildMemberProfile(currentUser)) {
|
|
r0 = null;
|
|
} else {
|
|
var viewBindingProps = {style: [styles.upsell, style]};
|
|
defaultImport2 = importDefault(4589) /* metro dependency 4589 */;
|
|
var defaultImport2Props2 = {style: styles.upsellCard, start: HorizontalGradient.START,
|
|
end: HorizontalGradient.END,
|
|
colors: Gradients.PREMIUM_GUILD};
|
|
defaultImport3 = importDefault(3802) /* metro dependency 3802: PremiumUtils */;
|
|
if (defaultImport3.isPremium(currentUser)) {
|
|
jsxRuntimeEnv0_11Binding = jsxRuntimeEnv0_11;
|
|
items2 = [<Text style={styles.title} accessibilityRole="header" variant="heading-lg/semibold" color="always-white">{intl.string(t.YYfHlx)}</Text>];
|
|
items2[1] = <Text style={styles.subtitle} variant="text-md/semibold" color="always-white">{intl.format(t.Af0zEZ,
|
|
|
|
{numFreeGuildSubscriptions: NUM_FREE_GUILD_BOOSTS_WITH_PREMIUM})}</Text>;
|
|
r9 = <>{items2}</>;
|
|
} else {
|
|
r9 = <Text style={styles.title} accessibilityRole="header" variant="heading-lg/semibold" color="always-white">{intl.string((require(1244) /* metro dependency 1244: indexNative */).t['qUl+K4'])}</Text>;
|
|
}
|
|
items3 = [r9];
|
|
var viewBinding2Props = {style: styles.upsellFeatures};
|
|
items4 = [<Image style={styles.upsellFeatureSubLogo} source={importDefault(12267) /* metro dependency 12267 */} />];
|
|
items4[1] = <Image style={styles.upsellFeatureLogoTier2} source={importDefault(12268) /* metro dependency 12268 */} />;
|
|
PremiumFeatureList = importDefault(7971) /* metro dependency 7971: PremiumFeatureList */;
|
|
var defaultImport4Props = {style: styles.upsellFeatureList};
|
|
object = {};
|
|
object.IconComponent = CheckmarkLargeIcon;
|
|
formatToPlainString = intl.formatToPlainString;
|
|
P3aEj6 = t.P3aEj6;
|
|
moduleValue2 = require(1856) /* metro dependency 1856: NumberUtils */;
|
|
object.label = Reflect.apply(formatToPlainString, intl, [P3aEj6,
|
|
{discountPercentage: moduleValue2.formatPercent(LocaleStore.locale,
|
|
GUILD_BOOST_COST_FOR_PREMIUM_USER_DISCOUNT_PERCENT / 100)}]);
|
|
unsafe_rawColors = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors;
|
|
WHITE = unsafe_rawColors.WHITE;
|
|
object.color = WHITE;
|
|
items5 = [object];
|
|
object2 = {};
|
|
object2.IconComponent = CheckmarkLargeIcon;
|
|
object2.label = intl.formatToPlainString(t.Ntlzbd,
|
|
{numFreeGuildSubscriptions: NUM_FREE_GUILD_BOOSTS_WITH_PREMIUM});
|
|
unsafe_rawColors = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors;
|
|
WHITE = unsafe_rawColors.WHITE;
|
|
object2.color = WHITE;
|
|
items5[1] = object2;
|
|
defaultImport4Props.features = items5;
|
|
defaultImport4Props.labelStyle = styles.upsellLabel;
|
|
defaultImport4Props.rowStyle = styles.upsellRow;
|
|
items4[2] = <PremiumFeatureList {...defaultImport4Props} />;
|
|
items3[1] = <View {...viewBinding2Props}>{items4}</View>;
|
|
items3[2] = <View style={styles.upsellButton}>{((Button) => <Button variant="experimental_premium-secondary" text={intl.string(t.fJOECn)} onPress={onLearnMorePremium} />)((require(4578) /* metro dependency 4578: ButtonNative */).Button)}</View>;
|
|
r0 = <View {...viewBindingProps}>{((Component) => <Component {...defaultImport2Props2}>{items3}</Component>)(defaultImport2)}</View>;
|
|
}
|
|
return r0;
|
|
}
|
|
|