199 lines
12 KiB
TypeScript
199 lines
12 KiB
TypeScript
/* Metro module 10352; source: modules/user_profile/native/UserProfileDismissibleUpsells.tsx; dependencies: [31, 27, 1878, 8516, 7047, 1376, 33, 4501, 697, 10353, 8514, 566, 3802, 10357, 1365, 1305, 4573, 1244, 5278, 5312, 4578, 7954, 10358, 2] */
|
|
import UserStore from '../../../stores/UserStore.tsx'; /* Metro dependency 1878 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactNativeModule from '../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
|
|
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as JsxRuntimeModule from '../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
|
|
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as Dismissible_contentModule from '../../../external/discord_common/js/packages/protos/discord_protos/discord_users/v1/dismissible_content.tsx'; /* Metro dependency 1365 */
|
|
import * as DismissibleContentConstantsModule from '../../dismissible_content/DismissibleContentConstants.tsx'; /* Metro dependency 1376 */
|
|
import * as PremiumUtilsModule from '../../../utils/PremiumUtils.tsx'; /* Metro dependency 3802 */
|
|
import * as ButtonNativeModule from '../../../design/components/Button/native/Button.native.tsx'; /* Metro dependency 4578 */
|
|
import * as ColorConstantsModule from '../../colors/native/ColorConstants.tsx'; /* Metro dependency 7047 */
|
|
import * as UserProfileAnalyticsContextModule from '../UserProfileAnalyticsContext.tsx'; /* Metro dependency 8514 */
|
|
import * as ConstantsModule from '../Constants.tsx'; /* Metro dependency 8516 */
|
|
import * as UserProfilePrivacyNoticeModule from './UserProfilePrivacyNotice.tsx'; /* Metro dependency 10353 */
|
|
|
|
function _fun80218(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#80218, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10538:6, offset: 0x01e719bd, size: 460 bytes, params: 8, frame: 23
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const Gradients = (ColorConstantsModule).Gradients;
|
|
let value = JsxRuntimeModule;
|
|
const env0_8 = value.jsx;
|
|
const env0_9 = value.jsxs;
|
|
const PREMIUM_GUILD = Gradients.PREMIUM_GUILD;
|
|
object = [];
|
|
arraySpread(object, PREMIUM_GUILD, 0, undefined);
|
|
const env0_10 = object.reverse();
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object = {};
|
|
const object2 = {'paddingVertical': 16, 'paddingHorizontal': 12};
|
|
object2.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
|
|
const BACKGROUND_SURFACE_HIGH = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SURFACE_HIGH;
|
|
object2.backgroundColor = BACKGROUND_SURFACE_HIGH;
|
|
object.upsellContainer = object2;
|
|
const PROFILE_GRADIENT_OVERLAY_SYNCED_WITH_USER_THEME = (importDefault(697) /* metro dependency 697: native */).colors.PROFILE_GRADIENT_OVERLAY_SYNCED_WITH_USER_THEME;
|
|
object.customProfileThemeUpsellContainer = {backgroundColor: PROFILE_GRADIENT_OVERLAY_SYNCED_WITH_USER_THEME};
|
|
object.header = {'display': 'flex', 'flexDirection': 'row', 'justifyContent': 'space-between',
|
|
'alignItems': 'center'};
|
|
object.upsellButtonsContainer = {'display': 'flex', 'flexDirection': 'row', 'justifyContent': 'space-between',
|
|
'flexWrap': 'wrap', 'gap': 10, 'marginTop': 12};
|
|
object.upsellButton = {flex: 1};
|
|
const env0_11 = Reflect.apply(createStyles, value, [object]);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/user_profile/native/UserProfileDismissibleUpsells.tsx');
|
|
exports.default = UserProfileDismissibleUpsells;
|
|
function UserProfileDismissibleUpsells({navigateToShop, navigateToPremium, hasCustomProfileTheme}) { // fn#80219, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10538:914, offset: 0x01e71b89, size: 397 bytes, params: 2, frame: 23
|
|
var r0;
|
|
var value;
|
|
const env0_3 = useStyles();
|
|
const value2 = (UserProfilePrivacyNoticeModule).useIsPrivacyNoticeVisible();
|
|
const useUserProfileAnalyticsContext = UserProfileAnalyticsContextModule.useUserProfileAnalyticsContext;
|
|
const trackUserProfileAction = Reflect.apply(useUserProfileAnalyticsContext, UserProfileAnalyticsContextModule,
|
|
[]).trackUserProfileAction;
|
|
const currentUser = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
|
|
return UserStore.getCurrentUser();
|
|
});
|
|
const env0_5 = (PremiumUtilsModule).isPremium(currentUser);
|
|
const binding = env0_3;
|
|
const env0_6 = binding.useCallback(function() {
|
|
trackUserProfileAction({action: TrackUserProfileActions.VISIT_SHOP});
|
|
navigateToShop();
|
|
}, [navigateToShop, trackUserProfileAction]);
|
|
const env0_7 = binding.useCallback(function() {
|
|
trackUserProfileAction({action: TrackUserProfileActions.GET_PREMIUM});
|
|
navigateToPremium();
|
|
}, [navigateToPremium, trackUserProfileAction]);
|
|
const env0_8 = binding.useCallback(function() {
|
|
trackUserProfileAction({action: TrackUserProfileActions.VIEW_PREMIUM_PERKS});
|
|
navigateToPremium();
|
|
}, [navigateToPremium, trackUserProfileAction]);
|
|
if (value2) {
|
|
value = importDefault(10353) /* metro dependency 10353: UserProfilePrivacyNotice */;
|
|
value = ((Component) => <Component />)(value);
|
|
r0 = value;
|
|
} else {
|
|
r0 = ((Component) => <Component contentTypes={[(require(1365) /* metro dependency 1365: dismissible_content */).DismissibleContent.USER_PROFILE_PREMIUM_AND_SHOP_ENTRY_POINTS]}>{children_80224}</Component>)(importDefault(10357) /* metro dependency 10357: SelectedDismissibleContent */);
|
|
}
|
|
return r0;
|
|
function UserProfileDismissibleUpsellsChildren({visibleContent, markAsDismissed}) { // fn#80224, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10538:1535, owner: UserProfileDismissibleUpsells.children, offset: 0x01e71d97, size: 964 bytes, params: 2, frame: 36
|
|
var environment;
|
|
var r15;
|
|
var r0;
|
|
var GradientBorder;
|
|
var object2;
|
|
var object3;
|
|
var stylesBinding;
|
|
var object5;
|
|
var Text;
|
|
const intl = (IndexNativeModule).intl;
|
|
var string;
|
|
const t = (IndexNativeModule).t;
|
|
var items4;
|
|
var PressableOpacity;
|
|
var items2;
|
|
var object9;
|
|
var upsellButton;
|
|
const Button = (ButtonNativeModule).Button;
|
|
var object10;
|
|
var binding;
|
|
var items3;
|
|
const value = environment.__proto__;
|
|
const DismissibleContent = (Dismissible_contentModule).DismissibleContent;
|
|
const USER_PROFILE_PREMIUM_AND_SHOP_ENTRY_POINTS = DismissibleContent.USER_PROFILE_PREMIUM_AND_SHOP_ENTRY_POINTS;
|
|
if (visibleContent !== USER_PROFILE_PREMIUM_AND_SHOP_ENTRY_POINTS) {
|
|
r0 = null;
|
|
} else {
|
|
GradientBorder = (require(1305) /* metro dependency 1305: native */).GradientBorder;
|
|
var gradientBorderProps = {borderWidth: 2,
|
|
direction: (require(1305) /* metro dependency 1305: native */).GradientBorder.Direction.VERTICAL,
|
|
colors: env1_10, borderRadius: (importDefault(697) /* metro dependency 697: native */).radii.lg};
|
|
object2 = {};
|
|
object3 = {};
|
|
copyDataProperties(object3, styles.upsellContainer, undefined);
|
|
copyDataProperties(object3, hasCustomProfileTheme ? styles.customProfileThemeUpsellContainer : {}, undefined);
|
|
object2.style = object3;
|
|
object5 = {};
|
|
stylesBinding = styles;
|
|
object5.style = stylesBinding.header;
|
|
Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
string = intl.string;
|
|
items4 = [
|
|
<Text accessibilityRole="header" variant="text-sm/semibold">
|
|
{Reflect.apply(string, intl, [t.EIYbj6])}
|
|
</Text>,
|
|
];
|
|
PressableOpacity = (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity;
|
|
string = intl.string;
|
|
items4[1] = (
|
|
<PressableOpacity
|
|
accessibilityRole="button"
|
|
accessibilityLabel={Reflect.apply(string, intl, [t['6Xcq+Y']])}
|
|
onPress={function() {
|
|
return markAsDismissed(ContentDismissActionType.USER_DISMISS);
|
|
}}
|
|
>
|
|
{((XSmallIcon) => <XSmallIcon size="sm" />)((require(5312) /* metro dependency 5312: XSmallIcon */).XSmallIcon)}
|
|
</PressableOpacity>
|
|
);
|
|
items2 = [
|
|
<View {...object5}>
|
|
{items4}
|
|
</View>,
|
|
];
|
|
var viewBinding2Props = {style: stylesBinding.upsellButtonsContainer};
|
|
object9 = {};
|
|
upsellButton = stylesBinding.upsellButton;
|
|
object9.style = upsellButton;
|
|
object10 = {'text': null, 'onPress': null, 'icon': null, 'iconPosition': 'start', 'variant': 'secondary',
|
|
'shiny': true};
|
|
binding = env0_5;
|
|
string = intl.string;
|
|
r15 = binding ? Reflect.apply(string, intl, [t['0Q61kF']]) : Reflect.apply(string, intl, [t.x6rkDp]);
|
|
object10.text = r15;
|
|
r15 = env0_5 ? env0_8 : env0_7;
|
|
object10.onPress = r15;
|
|
object10.icon = ((NitroWheelIcon) => <NitroWheelIcon size="sm" />)((require(7954) /* metro dependency 7954: NitroWheelIcon */).NitroWheelIcon);
|
|
items3 = [
|
|
<View {...object9}>
|
|
<Button {...object10} />
|
|
</View>,
|
|
];
|
|
upsellButton = styles.upsellButton;
|
|
string = intl.string;
|
|
items3[1] = (
|
|
<View style={upsellButton}>
|
|
<Button
|
|
text={Reflect.apply(string, intl, [t.pWG4ze])}
|
|
onPress={env0_6}
|
|
icon={((ShopIcon) => <ShopIcon size="sm" />)((require(10358) /* metro dependency 10358: ShopIcon */).ShopIcon)}
|
|
iconPosition="start"
|
|
variant="secondary"
|
|
/>
|
|
</View>
|
|
);
|
|
items2[1] = (
|
|
<View {...viewBinding2Props}>
|
|
{items3}
|
|
</View>
|
|
);
|
|
r0 = (
|
|
<GradientBorder {...gradientBorderProps}>
|
|
<View {...object2}>
|
|
{items2}
|
|
</View>
|
|
</GradientBorder>
|
|
);
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun80218, 10352, [31, 27, 1878, 8516, 7047, 1376, 33, 4501, 697, 10353, 8514, 566, 3802, 10357, 1365,
|
|
1305, 4573, 1244, 5278, 5312, 4578, 7954, 10358,
|
|
2]) /* metro module 10352, dependencies: [31, 27, 1878, 8516, 7047, 1376, 33, 4501, 697, 10353, 8514, 566, 3802, 10357, 1365, 1305, 4573, 1244, 5278, 5312, 4578, 7954, 10358, 2] */;
|