518 lines
29 KiB
TypeScript
518 lines
29 KiB
TypeScript
/* Metro module 8695; source: modules/user_profile/native/UserProfilePrimaryInfo.tsx; dependencies: [31, 27, 8516, 6816, 661, 8187, 33, 4501, 697, 8696, 8697, 8706, 5278, 8708, 4573, 8710, 7122, 4008, 10497, 1244, 10499, 7635, 7007, 3857, 8501, 683, 7120, 6531, 477, 10500, 1478, 8401, 9299, 3995, 2] */
|
|
import UseWindowDimensionsNative from '../../screen/useWindowDimensions.native.tsx'; /* Metro dependency 1478 */
|
|
import UsernameWithEffects from '../../display_name_styles/native/UsernameWithEffects.tsx'; /* Metro dependency 8696 */
|
|
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 IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as RootNavigationRefNativeModule from '../../main_tabs_v2/RootNavigationRef.native.tsx'; /* Metro dependency 4008 */
|
|
import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
|
|
import * as AdDataUtilsAndroidModule from '../../ads/utils/AdDataUtils.android.tsx'; /* Metro dependency 7122 */
|
|
import * as GuildTagConstantsModule from '../../guild_tag/GuildTagConstants.tsx'; /* Metro dependency 8187 */
|
|
import * as TypesModule from '../../display_name_styles/types.tsx'; /* Metro dependency 8697 */
|
|
|
|
function _fun68322(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#68322, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8880:6, offset: 0x01c48e9c, size: 731 bytes, params: 8, frame: 27
|
|
const env0_0 = require;
|
|
const DisplayName2 = DisplayName;
|
|
const UserTagAndPronouns2 = UserTagAndPronouns;
|
|
const ProfileBadgeRows2 = ProfileBadgeRows;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactNativeModule;
|
|
const env0_4 = value.Image;
|
|
const env0_5 = value.View;
|
|
value = require(8516) /* metro dependency 8516: Constants */;
|
|
const env0_6 = value.getBadgeAssetFromCDN;
|
|
const env0_7 = value.getBadgeName;
|
|
value = require(6816) /* metro dependency 6816: Constants */;
|
|
const env0_8 = value.DIVIDER_DOT;
|
|
const env0_9 = value.PROFILE_SIDE_PADDING;
|
|
const UserProfileThemeTypes = value.UserProfileThemeTypes;
|
|
value = require(661) /* metro dependency 661: Constants */;
|
|
const env0_11 = value.AnalyticEvents;
|
|
const env0_12 = value.UserSettingsSections;
|
|
const GuildTagBadgeSize = (GuildTagConstantsModule).GuildTagBadgeSize;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_13 = value.jsx;
|
|
const env0_14 = value.jsxs;
|
|
const env0_15 = value.Fragment;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object = {};
|
|
object.container = {flexDirection: 'column'};
|
|
object.displayName = {'flexDirection': 'row', 'alignItems': 'center', 'columnGap': 4};
|
|
object.details = {'flexDirection': 'row', 'flexWrap': 'wrap', 'gap': 8};
|
|
object.detailsText = {'flexDirection': 'row', 'flexWrap': 'wrap', 'alignContent': 'center', 'paddingVertical': 2};
|
|
object.botTag = {marginLeft: 4};
|
|
const object4 = {'alignSelf': 'center', 'justifyContent': 'center', 'borderRadius': null, 'columnGap': 4};
|
|
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
|
|
object.guildTag = object4;
|
|
object.transparentBackground = {backgroundColor: 'transparent'};
|
|
object.badge = {resizeMode: 'contain'};
|
|
object.badges = {'alignSelf': 'center', 'flexDirection': 'column', 'justifyContent': 'flex-start', 'rowGap': 8};
|
|
const object6 = {'borderRadius': null, 'paddingVertical': 2, 'justifyContent': 'flex-start', 'flexDirection': 'row',
|
|
'marginRight': 'auto', 'columnGap': 4};
|
|
object6.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
|
|
object.badgeRow = object6;
|
|
const env0_16 = Reflect.apply(createStyles, value, [object]);
|
|
object = {'headingVariant': 'heading-xl/bold', 'textVariant': 'text-md/normal', 'badgeSize': 20,
|
|
'badgeRowHorizontalPadding': 7, 'guildTagBadgeSize': null, 'guildTagTextVariant': 'text-sm/medium',
|
|
'guildTagHorizontalPadding': 8};
|
|
const SIZE_16 = GuildTagBadgeSize.SIZE_16;
|
|
object.guildTagBadgeSize = SIZE_16;
|
|
object = {};
|
|
const PREVIEW = UserProfileThemeTypes.PREVIEW;
|
|
const SIZE_12 = GuildTagBadgeSize.SIZE_12;
|
|
object[PREVIEW] = {'headingVariant': 'heading-lg/bold', 'textVariant': 'text-sm/normal', 'badgeSize': 16,
|
|
'badgeRowHorizontalPadding': 6, 'guildTagBadgeSize': null, 'guildTagTextVariant': 'text-xs/medium',
|
|
'guildTagHorizontalPadding': 6, guildTagBadgeSize: SIZE_12};
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/user_profile/native/UserProfilePrimaryInfo.tsx');
|
|
exports.default = UserProfilePrimaryInfo;
|
|
exports.DisplayName = DisplayName2;
|
|
exports.UserTagAndPronouns = UserTagAndPronouns2;
|
|
exports.ProfileBadgeRows = ProfileBadgeRows2;
|
|
function DisplayName({user, guildId, name, themeType, onPress, accessibilityHint, showChevron, pendingDisplayNameStyles, displayNameAccessibilityRole}) { // fn#68323, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8880:1564, offset: 0x01c49177, size: 341 bytes, params: 2, frame: 22
|
|
var r0;
|
|
var PressableOpacity;
|
|
var items2;
|
|
showChevron = !(showChevron === undefined) && showChevron;
|
|
var value;
|
|
const styles = useStyles();
|
|
const env0_6 = getStyleConfig(themeType).headingVariant;
|
|
const renderDisplayName2 = renderDisplayName;
|
|
const renderBotTag2 = renderBotTag;
|
|
if (onPress == null) {
|
|
value = renderDisplayName2();
|
|
value = (
|
|
<View>
|
|
{[value, renderBotTag2()]}
|
|
</View>
|
|
);
|
|
r0 = value;
|
|
} else {
|
|
PressableOpacity = (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity;
|
|
var pressableOpacityProps = {onPress: onPress, accessibilityRole: 'button', accessibilityLabel: name,
|
|
accessibilityHint: accessibilityHint, style: styles.displayName};
|
|
items2 = [renderDisplayName2(), renderBotTag2()];
|
|
items2[2] = showChevron && ((ChevronSmallDownIcon) => <ChevronSmallDownIcon size="sm" color="icon-muted" />)((require(8708) /* metro dependency 8708: ChevronSmallDownIcon */).ChevronSmallDownIcon);
|
|
r0 = (
|
|
<PressableOpacity {...pressableOpacityProps}>
|
|
{items2}
|
|
</PressableOpacity>
|
|
);
|
|
}
|
|
return r0;
|
|
function renderDisplayName() { // fn#68324, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8880:1792, owner: DisplayName.renderDisplayName, offset: 0x01c492cc, size: 149 bytes, params: 1, frame: 17
|
|
const id = user.id;
|
|
const guildIdBinding = guildId;
|
|
const nameBinding = name;
|
|
const headingVariantBinding = headingVariant;
|
|
const EffectDisplayType = (TypesModule).EffectDisplayType;
|
|
const STATIC = EffectDisplayType.STATIC;
|
|
return (
|
|
<UsernameWithEffects
|
|
userId={id}
|
|
guildId={guildIdBinding}
|
|
userName={nameBinding}
|
|
variant={headingVariantBinding}
|
|
effectDisplayType={STATIC}
|
|
lineClamp={2}
|
|
pendingDisplayNameStyles={pendingDisplayNameStyles}
|
|
defaultColor="mobile-text-heading-primary"
|
|
accessibilityRole={displayNameAccessibilityRole}
|
|
/>
|
|
);
|
|
}
|
|
|
|
function renderBotTag() { // fn#68325, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8880:2020, owner: DisplayName.renderBotTag, offset: 0x01c49361, size: 229 bytes, params: 1, frame: 19
|
|
const userBinding = user;
|
|
return (
|
|
userBinding.isSystemUser()
|
|
? ((Component) => <Component style={styles.botTag} type={(importDefault(8706) /* metro dependency 8706: BotTag */).Types.SYSTEM_DM} verified={user.isVerifiedBot()} />)(importDefault(8706) /* metro dependency 8706: BotTag */)
|
|
: (
|
|
user.bot
|
|
? ((Component) => <Component style={styles.botTag} type={(importDefault(8706) /* metro dependency 8706: BotTag */).Types.BOT} verified={user.isVerifiedBot()} />)(importDefault(8706) /* metro dependency 8706: BotTag */)
|
|
: null
|
|
)
|
|
);
|
|
}
|
|
|
|
}
|
|
|
|
function UserTagAndPronouns({userTag, pronouns, themeType, onPressUserTag, userTagAccessibilityHint, onPressPronouns, pronounsAccessibilityHint}) { // fn#68326, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8880:2532, offset: 0x01c49446, size: 414 bytes, params: 2, frame: 30
|
|
var jsxRuntimeEnv0_15Binding;
|
|
var items2;
|
|
const userTagAccessibilityHint2 = userTagAccessibilityHint;
|
|
const styles = useStyles();
|
|
let r5 = pronouns != null && pronouns.length > 0;
|
|
const textVariant = getStyleConfig(themeType).textVariant;
|
|
const value4 = userTagAccessibilityHint2.useCallback(_fun68327, [onPressUserTag, textVariant, userTag,
|
|
userTagAccessibilityHint]);
|
|
const renderPronouns2 = renderPronouns;
|
|
const value5 = value4();
|
|
if (r5) {
|
|
jsxRuntimeEnv0_15Binding = jsxRuntimeEnv0_15;
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
items2 = [
|
|
<Text
|
|
variant={textVariant}
|
|
color="mobile-text-heading-primary"
|
|
accessibilityElementsHidden
|
|
importantForAccessibility="no-hide-descendants"
|
|
>
|
|
{DIVIDER_DOT}
|
|
</Text>,
|
|
];
|
|
items2[1] = (
|
|
onPressUserTag != null
|
|
? ((PressableOpacity) => <PressableOpacity onPress={onPressPronouns} accessibilityRole="button" accessibilityLabel={pronouns} accessibilityHint={pronounsAccessibilityHint}>{renderPronouns2()}</PressableOpacity>)((require(5278) /* metro dependency 5278: Pressables */).PressableOpacity)
|
|
: (
|
|
<View>
|
|
{renderPronouns2()}
|
|
</View>
|
|
)
|
|
);
|
|
r5 = (
|
|
<>
|
|
{items2}
|
|
</>
|
|
);
|
|
}
|
|
return (
|
|
<View style={styles.detailsText}>
|
|
{value5}
|
|
{r5}
|
|
</View>
|
|
);
|
|
function _fun68327() { // fn#68327, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8880:2767, offset: 0x01c495e4, size: 197 bytes, params: 1, frame: 18
|
|
if (userTag == null) {
|
|
return null;
|
|
}
|
|
const Text = (TextModule).Text;
|
|
const text = (
|
|
<Text
|
|
variant={textVariant}
|
|
color="mobile-text-heading-primary"
|
|
lineClamp={2}
|
|
>
|
|
{userTag}
|
|
</Text>
|
|
);
|
|
if (onPressUserTag != null) {
|
|
const PressableOpacity = (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity;
|
|
return (
|
|
<PressableOpacity
|
|
onPress={onPressUserTag}
|
|
accessibilityRole="button"
|
|
accessibilityLabel={userTag}
|
|
accessibilityHint={userTagAccessibilityHint}
|
|
>
|
|
{text}
|
|
</PressableOpacity>
|
|
);
|
|
} else {
|
|
return (
|
|
<View>
|
|
{text}
|
|
</View>
|
|
);
|
|
}
|
|
}
|
|
|
|
function renderPronouns() { // fn#68328, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8880:3070, owner: UserTagAndPronouns.renderPronouns, offset: 0x01c496a9, size: 77 bytes, params: 1, frame: 15
|
|
const Text = (TextModule).Text;
|
|
return (
|
|
<Text
|
|
variant={textVariant}
|
|
color="mobile-text-heading-primary"
|
|
lineClamp={1}
|
|
>
|
|
{pronouns}
|
|
</Text>
|
|
);
|
|
}
|
|
|
|
}
|
|
|
|
function ProfileBadge({source, id, label, badgeSize, userId, themeType, showToastOnPress}) { // fn#68329, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8880:3563, offset: 0x01c496f6, size: 800 bytes, params: 2, frame: 29
|
|
showToastOnPress = showToastOnPress === undefined || showToastOnPress;
|
|
let env0_3 = undefined;
|
|
const styles = useStyles();
|
|
const r15 = badgeSize != null ? {width: badgeSize, height: badgeSize} : undefined;
|
|
const value5 = env0_3.useRef(null);
|
|
env0_3 = (require(8710) /* metro dependency 8710: useTieredTenureBadgeClickHandler */).useTieredTenureBadgeClickHandler(id,
|
|
userId, themeType);
|
|
const env0_4 = (AdDataUtilsAndroidModule).useAdUser('profile_badge');
|
|
const rootNavigationRef = (RootNavigationRefNativeModule).getRootNavigationRef();
|
|
const r5 = rootNavigationRef != null && rootNavigationRef.isReady() ? rootNavigationRef.getCurrentRoute() : undefined;
|
|
const showOrbsBadgeCoachmark = r5 == null || r5.params == null ? undefined : r5.params.showOrbsBadgeCoachmark;
|
|
const value9 = (require(10497) /* metro dependency 10497: OrbsBadgeCoachmark */).useOrbsBadgeCoachmark({disabled: !(showOrbsBadgeCoachmark != null && showOrbsBadgeCoachmark)});
|
|
const intl = (IndexNativeModule).intl;
|
|
const formatToPlainString = intl.formatToPlainString;
|
|
const A0LN9t = (IndexNativeModule).t.A0LN9t;
|
|
const value10 = Reflect.apply(formatToPlainString, intl, [A0LN9t, {badgeLabel: label}]);
|
|
let YOU_SCREEN = UserProfileThemeTypes.YOU_SCREEN;
|
|
const r7 = (
|
|
themeType === YOU_SCREEN && typeof id === 'string'
|
|
? ((Component) => <Component targetRef={value5} badgeId={id} />)(importDefault(10499) /* metro dependency 10499: TieredTenureBadgeCoachmark */)
|
|
: null
|
|
);
|
|
YOU_SCREEN = UserProfileThemeTypes.YOU_SCREEN;
|
|
const r6 = (
|
|
themeType === YOU_SCREEN && typeof id === 'string' && id === 'orb_profile_badge' && value9 != null
|
|
? ((Component) => <Component badgeRef={value5} {...value9.props} />)(importDefault(10497) /* metro dependency 10497: OrbsBadgeCoachmark */)
|
|
: null
|
|
);
|
|
const jsxRuntimeEnv0_15Binding = jsxRuntimeEnv0_15;
|
|
const object = {};
|
|
if (showToastOnPress) {
|
|
object.children = [
|
|
((PressableOpacity) => <PressableOpacity accessibilityRole="image" accessibilityLabel={value10} onPress={onPress_68330} ref={value5}><Image style={[styles.badge,
|
|
|
|
r15]} source={source} /></PressableOpacity>)((require(5278) /* metro dependency 5278: Pressables */).PressableOpacity),
|
|
|
|
|
|
r7,
|
|
r6,
|
|
];
|
|
} else {
|
|
object.children = [
|
|
<Image
|
|
style={[styles.badge, r15]}
|
|
source={source}
|
|
accessible
|
|
accessibilityRole="image"
|
|
accessibilityLabel={value10}
|
|
ref={value5}
|
|
/>,
|
|
r7,
|
|
r6,
|
|
];
|
|
}
|
|
return ((Fragment) => <Fragment {...object} />)(jsxRuntimeEnv0_15Binding);
|
|
function ProfileBadgeOnPress() { // fn#68330, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8880:4416, owner: ProfileBadge.onPress, offset: 0x01c49a16, size: 504 bytes, params: 1, frame: 22
|
|
var advertisingId;
|
|
var idBinding;
|
|
var value3;
|
|
var object;
|
|
var defaultImport;
|
|
var open;
|
|
var labelBinding;
|
|
var defaultImport2;
|
|
var track;
|
|
var QUEST_CONTENT_VIEWED;
|
|
var moduleValue;
|
|
var moduleValue2;
|
|
var moduleValue3;
|
|
const value2 = null;
|
|
if (value2 == env0_3) {
|
|
idBinding = id;
|
|
value3 = environment.__proto__;
|
|
if (idBinding !== getBadgeName(require(dependencyMap[21]).BadgeId.GIFTING)) {
|
|
defaultImport = importDefault(dependencyMap[23]);
|
|
open = defaultImport.open;
|
|
object = {};
|
|
labelBinding = label;
|
|
object.key = 'PROFILE_BADGE-' + labelBinding;
|
|
object.content = labelBinding;
|
|
object.icon = source;
|
|
Reflect.apply(open, defaultImport, [object]);
|
|
if (id === require(dependencyMap[24]).QUEST_COMPLETED_BADGE) {
|
|
defaultImport2 = importDefault(dependencyMap[25]);
|
|
track = defaultImport2.track;
|
|
QUEST_CONTENT_VIEWED = AnalyticEvents.QUEST_CONTENT_VIEWED;
|
|
object = {};
|
|
moduleValue = require(dependencyMap[26]);
|
|
copyDataProperties(object,
|
|
moduleValue.getContentProperties(require(dependencyMap[27]).QuestContent.QUEST_BADGE),
|
|
dependencyMap);
|
|
if (value2 != env0_4) {
|
|
moduleValue2 = require(dependencyMap[28]);
|
|
advertisingId = moduleValue2.isIOS() ? env0_4.advertisingId : value2;
|
|
} else {
|
|
advertisingId = value2;
|
|
}
|
|
object['apple_advertising_id'] = advertisingId;
|
|
if (value2 != env0_4) {
|
|
moduleValue3 = require(dependencyMap[28]);
|
|
advertisingId = moduleValue3.isAndroid() ? env0_4.advertisingId : value2;
|
|
} else {
|
|
advertisingId = value2;
|
|
}
|
|
object['android_advertising_id'] = advertisingId;
|
|
object['is_targeted'] = false;
|
|
Reflect.apply(track, defaultImport2, [QUEST_CONTENT_VIEWED, object]);
|
|
}
|
|
} else {
|
|
require(dependencyMap[22]).openUserSettings({screen: UserSettingsSections.PREMIUM_GIFTING, params: {}});
|
|
}
|
|
} else {
|
|
env0_3();
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function ProfileBadgeRows({userId, badges, isTryItOut, style, themeType, showToastOnPress}) { // fn#68331, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8880:5071, offset: 0x01c49c0e, size: 519 bytes, params: 2, frame: 27
|
|
var push;
|
|
var object2;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
var formatToPlainString;
|
|
var property;
|
|
var Date;
|
|
var value6;
|
|
var date;
|
|
const showToastOnPress2 = showToastOnPress;
|
|
const styles = useStyles();
|
|
const {badgeSize, badgeRowHorizontalPadding} = getStyleConfig(themeType);
|
|
const value3 = badges.map(_fun68332);
|
|
if (isTryItOut && badges.find(function(a0) {
|
|
return a0.id === 'premium';
|
|
}) == null) {
|
|
push = value3.push;
|
|
var profileBadgeProps = {source: importDefault(10500) /* metro dependency 10500 */, id: 'premium',
|
|
userId: userId};
|
|
formatToPlainString = intl.formatToPlainString;
|
|
property = (require(1244) /* metro dependency 1244: indexNative */).t['8zbGNR'];
|
|
Date = global.Date;
|
|
value6 = Object.create(Date.prototype, {constructor: {value: Date}});
|
|
date = new Date();
|
|
profileBadgeProps.label = Reflect.apply(formatToPlainString, intl, [property,
|
|
{date: date instanceof Object ? date : value6}]);
|
|
profileBadgeProps.badgeSize = badgeSize;
|
|
profileBadgeProps.showToastOnPress = showToastOnPress;
|
|
Reflect.apply(push, value3, [<ProfileBadge {...profileBadgeProps} />]);
|
|
}
|
|
const value8 = showToastOnPress2.useMemo(_fun68334, [value3, badgeRowHorizontalPadding, badgeSize,
|
|
(UseWindowDimensionsNative)().width]);
|
|
const items2 = [styles.badges];
|
|
const string = intl.string;
|
|
const VWV0y5 = (require(1244) /* metro dependency 1244: indexNative */).t.VWV0y5;
|
|
return (
|
|
<View
|
|
style={items2}
|
|
accessibilityRole="list"
|
|
accessibilityLabel={Reflect.apply(string, intl, [VWV0y5])}
|
|
>
|
|
{value8.map(_fun68336)}
|
|
</View>
|
|
);
|
|
function _fun68332(a0) { // fn#68332, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8880:5253, offset: 0x01c49e15, size: 126 bytes, params: 2, frame: 20
|
|
const value = environment.__proto__;
|
|
const profileBadgeBindingProps = {id: a0.id, userId: userId};
|
|
const object2 = {};
|
|
object2.uri = a0.iconSrc ?? getBadgeAssetFromCDN(a0.icon);
|
|
profileBadgeBindingProps.source = object2;
|
|
profileBadgeBindingProps.label = a0.description;
|
|
profileBadgeBindingProps.badgeSize = badgeSize;
|
|
profileBadgeBindingProps.themeType = themeType;
|
|
profileBadgeBindingProps.showToastOnPress = showToastOnPress;
|
|
return <ProfileBadge {...profileBadgeBindingProps} key={a0.id} />;
|
|
}
|
|
|
|
function _fun68334() { // fn#68334, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8880:5672, offset: 0x01c49ea5, size: 143 bytes, params: 1, frame: 18
|
|
let Math = global.Math;
|
|
const value6 = Math.floor((width - 2 * PROFILE_SIDE_PADDING - 2 * badgeRowHorizontalPadding + 4) / (badgeSize + 4));
|
|
const Array = global.Array;
|
|
const from = Array.from;
|
|
Math = global.Math;
|
|
return Reflect.apply(from, Array, [{length: Math.ceil(env0_7.length / value6)}, _fun68335]);
|
|
function _fun68335(a0, a1) { // fn#68335, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8880:5765, offset: 0x01c49f34, size: 45 bytes, params: 3, frame: 15
|
|
const value = environment.__proto__;
|
|
const binding = env1_7;
|
|
const slice = binding.slice;
|
|
const binding2 = env0_0;
|
|
return Reflect.apply(slice, binding, [a1 * binding2, (a1 + 1) * binding2]);
|
|
}
|
|
|
|
}
|
|
|
|
function _fun68336(a0, a1) { // fn#68336, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8880:5937, offset: 0x01c49f61, size: 81 bytes, params: 3, frame: 17
|
|
return (
|
|
<View style={[styles.badgeRow, {paddingHorizontal: badgeRowHorizontalPadding}, style]} key={a1}>
|
|
{a0}
|
|
</View>
|
|
);
|
|
}
|
|
|
|
}
|
|
|
|
function GuildTag({user, themeType, style, showToastOnPress}) { // fn#68337, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8880:6011, offset: 0x01c49fb2, size: 386 bytes, params: 2, frame: 27
|
|
showToastOnPress = !(showToastOnPress === undefined) && showToastOnPress;
|
|
const styles = useStyles();
|
|
const {tag,
|
|
guildId} = (require(8401) /* metro dependency 8401: GuildTagUtils */).getUserPrimaryGuild(user?.primaryGuild);
|
|
const {badgeSize, guildTagBadgeSize, guildTagHorizontalPadding, guildTagTextVariant} = getStyleConfig(themeType);
|
|
const r6 = (require(477) /* metro dependency 477: PlatformUtils */).isAndroid() ? 2 : 4;
|
|
const TextStyleSheet = (TextModule).TextStyleSheet;
|
|
return (
|
|
tag == null || guildId == null
|
|
? null
|
|
: (
|
|
<View
|
|
style={[styles.guildTag, {minHeight: badgeSize + 4, paddingHorizontal: guildTagHorizontalPadding},
|
|
style]}
|
|
>
|
|
{((Component) => <Component userId={user.id} disabledTooltip={!showToastOnPress} containerStyles={styles.transparentBackground} textStyle={{lineHeight: TextStyleSheet[guildTagTextVariant].fontSize + r6}} badgeSize={guildTagBadgeSize} textVariant={guildTagTextVariant} />)(importDefault(9299) /* metro dependency 9299: GuildTag */)}
|
|
</View>
|
|
)
|
|
);
|
|
}
|
|
|
|
function getStyleConfig(a0) { // fn#68338, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8880:1514, offset: 0x01c4a134, size: 38 bytes, params: 2, frame: 4
|
|
let r0 = a0 != null ? env0_18[a0] : undefined;
|
|
r0 = r0 ?? env0_17;
|
|
return r0;
|
|
}
|
|
|
|
function UserProfilePrimaryInfo({user, guildId, displayName, pronouns, style, badges, badgeContainerBackground, themeType, onPressDisplayName, displayNameAccessibilityHint, displayNameAccessibilityRole, onPressUserTag, userTagAccessibilityHint, onPressPronouns, pronounsAccessibilityHint, showChevron, showBadgeToastOnPress, pendingDisplayNameStyles}) { // fn#68339, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8880:6688, offset: 0x01c4a15a, size: 501 bytes, params: 2, frame: 38
|
|
const styles = useStyles();
|
|
const object = {backgroundColor: badgeContainerBackground};
|
|
const value2 = (importDefault(3995) /* metro dependency 3995: UserUtils */).useName(user);
|
|
return (
|
|
<View style={[styles.container, style]}>
|
|
<DisplayName
|
|
user={user}
|
|
guildId={guildId}
|
|
name={displayName === '' ? value2 : displayName ?? value2}
|
|
themeType={themeType}
|
|
onPress={onPressDisplayName}
|
|
accessibilityHint={displayNameAccessibilityHint}
|
|
displayNameAccessibilityRole={displayNameAccessibilityRole}
|
|
showChevron={showChevron}
|
|
pendingDisplayNameStyles={pendingDisplayNameStyles}
|
|
/>
|
|
<View style={styles.details}>
|
|
<UserTagAndPronouns
|
|
userTag={user.isProvisional ? null : (importDefault(3995) /* metro dependency 3995: UserUtils */).useUserTag(user)}
|
|
pronouns={pronouns}
|
|
themeType={themeType}
|
|
onPressUserTag={onPressUserTag}
|
|
userTagAccessibilityHint={userTagAccessibilityHint}
|
|
onPressPronouns={onPressPronouns}
|
|
pronounsAccessibilityHint={pronounsAccessibilityHint}
|
|
/>
|
|
<GuildTag
|
|
user={user}
|
|
themeType={themeType}
|
|
style={object}
|
|
showToastOnPress={showBadgeToastOnPress}
|
|
/>
|
|
<ProfileBadgeRows
|
|
userId={user.id}
|
|
badges={badges}
|
|
style={object}
|
|
themeType={themeType}
|
|
showToastOnPress={showBadgeToastOnPress}
|
|
/>
|
|
</View>
|
|
</View>
|
|
);
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun68322, 8695, [31, 27, 8516, 6816, 661, 8187, 33, 4501, 697, 8696, 8697, 8706, 5278, 8708, 4573, 8710,
|
|
7122, 4008, 10497, 1244, 10499, 7635, 7007, 3857, 8501, 683, 7120, 6531, 477, 10500, 1478, 8401, 9299, 3995,
|
|
2]) /* metro module 8695, dependencies: [31, 27, 8516, 6816, 661, 8187, 33, 4501, 697, 8696, 8697, 8706, 5278, 8708, 4573, 8710, 7122, 4008, 10497, 1244, 10499, 7635, 7007, 3857, 8501, 683, 7120, 6531, 477, 10500, 1478, 8401, 9299, 3995, 2] */;
|