260 lines
16 KiB
TypeScript
260 lines
16 KiB
TypeScript
/* Metro module 8779; source: modules/user_profile/native/BotUserProfileContent.tsx; dependencies: [31, 27, 1878, 6816, 6276, 33, 8496, 8752, 8760, 1585, 8514, 566, 4617, 3995, 6902, 8501, 8693, 8494, 8497, 6797, 3856, 8761, 8780, 4017, 8510, 8513, 4080, 8692, 1962, 8695, 1244, 8817, 8867, 8063, 8868, 4578, 6682, 697, 5080, 4603, 10210, 8762, 6792, 10288, 10327, 2] */
|
|
import Native from '../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
|
|
import UseSafeAreaInsetsNative from '../../safe_area/useSafeAreaInsets.native.tsx'; /* Metro dependency 1585 */
|
|
import UserStore from '../../../stores/UserStore.tsx'; /* Metro dependency 1878 */
|
|
import ReanimatedRexport from '../../reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
|
|
import NicknameUtils from '../../../utils/NicknameUtils.tsx'; /* Metro dependency 4617 */
|
|
import UseProfileTheme from '../hooks/useProfileTheme.tsx'; /* Metro dependency 8494 */
|
|
import UserProfileSharedStyles from './UserProfileSharedStyles.tsx'; /* Metro dependency 8496 */
|
|
import UseBadges from '../hooks/useBadges.tsx'; /* Metro dependency 8501 */
|
|
import UserProfileCustomStatusBubble from './UserProfileCustomStatusBubble.tsx'; /* Metro dependency 8513 */
|
|
import UseCustomStatusActivityForUser from '../../custom_status/utils/useCustomStatusActivityForUser.tsx'; /* Metro dependency 8693 */
|
|
import UserProfilePrimaryInfo from './UserProfilePrimaryInfo.tsx'; /* Metro dependency 8695 */
|
|
import UseUserProfileBannerHeight from '../hooks/native/useUserProfileBannerHeight.tsx'; /* Metro dependency 8752 */
|
|
import UseUserProfileOverscrollStyles from './useUserProfileOverscrollStyles.tsx'; /* Metro dependency 8760 */
|
|
import UserProfileOverscrollBanner from './UserProfileOverscrollBanner.tsx'; /* Metro dependency 8761 */
|
|
import BotUserProfileOverflowMenu from './BotUserProfileOverflowMenu.tsx'; /* Metro dependency 8780 */
|
|
import UserProfileTextButtonGroup from './UserProfileTextButtonGroup.tsx'; /* Metro dependency 8867 */
|
|
import UserProfileActivity from './UserProfileActivity.tsx'; /* Metro dependency 10210 */
|
|
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 ToastUtilsModule from '../../toast/native/ToastUtils.tsx'; /* Metro dependency 3856 */
|
|
import * as ButtonNativeModule from '../../../design/components/Button/native/Button.native.tsx'; /* Metro dependency 4578 */
|
|
import * as ActionSheetConstantsModule from '../../action_sheet/native/ActionSheetConstants.tsx'; /* Metro dependency 6276 */
|
|
import * as ChatIconModule from '../../../design/components/Icon/native/redesign/generated/ChatIcon.tsx'; /* Metro dependency 6682 */
|
|
import * as ClipboardUtilsNativeModule from '../../../utils/ClipboardUtils.native.tsx'; /* Metro dependency 6797 */
|
|
import * as ConstantsModule from './Constants.tsx'; /* Metro dependency 6816 */
|
|
import * as UseUserProfileColorsModule from '../hooks/native/useUserProfileColors.tsx'; /* Metro dependency 8497 */
|
|
import * as UserProfileAnalyticsContextModule from '../UserProfileAnalyticsContext.tsx'; /* Metro dependency 8514 */
|
|
|
|
function _fun68635(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#68635, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8964:6, offset: 0x01c56adb, size: 262 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactModule;
|
|
value = value.memo(BotUserProfileContent);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/user_profile/native/BotUserProfileContent.tsx');
|
|
exports.default = value;
|
|
function BotUserProfileContent({user, channel, displayProfile, showUserProfileActionSheet, disableMessage, scrollPosition}) { // fn#68636, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8964:310, offset: 0x01c56be1, size: 2097 bytes, params: 2, frame: 53
|
|
var r33;
|
|
var r19;
|
|
var r18;
|
|
var moduleValue5;
|
|
var AddOrOpenAppButton;
|
|
var jsxRuntimeEnv0_11Binding2;
|
|
var UserProfileRolesCard;
|
|
var items8;
|
|
var UserProfileModeratorActions;
|
|
const value3 = (UserProfileSharedStyles)();
|
|
const value4 = (UseUserProfileBannerHeight)(ACTION_SHEET_MAX_WIDTH);
|
|
const {bannerAnimatedStyle, bannerImageAnimatedStyle, contentAnimatedStyle, blurAnimatedProps,
|
|
showBlur} = (UseUserProfileOverscrollStyles)({scrollPosition: scrollPosition,
|
|
bannerHeight: value4});
|
|
const bottom = (UseSafeAreaInsetsNative)().bottom;
|
|
const useUserProfileAnalyticsContext = UserProfileAnalyticsContextModule.useUserProfileAnalyticsContext;
|
|
const env0_2 = Reflect.apply(useUserProfileAnalyticsContext, UserProfileAnalyticsContextModule,
|
|
[]).trackUserProfileAction;
|
|
const currentUser = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
|
|
return UserStore.getCurrentUser();
|
|
});
|
|
const defaultImport3 = NicknameUtils;
|
|
const useName = defaultImport3.useName;
|
|
const guildId = displayProfile?.guildId;
|
|
let id = channel?.id;
|
|
const value6 = Reflect.apply(useName, defaultImport3, [guildId, id, user]);
|
|
const env0_3 = (importDefault(3995) /* metro dependency 3995: UserUtils */).useUserTag(user);
|
|
const application = displayProfile?.application;
|
|
const guild_id = channel?.guild_id;
|
|
(require(6902) /* metro dependency 6902: subscribeGuildMembers */).useSubscribeGuildMembers(env0_3.useMemo(function() {
|
|
return guild_id == null ? {} : user != null ? {[guild_id]: [user.id]} : {};
|
|
}, [guild_id, user]), 'BotUserProfileContent');
|
|
const value8 = (UseBadges)(displayProfile);
|
|
const value9 = (UseCustomStatusActivityForUser)(user.id);
|
|
const {theme, primaryColor,
|
|
secondaryColor} = (UseProfileTheme)({user: user,
|
|
displayProfile: displayProfile});
|
|
const {containerBackground, avatarBackground,
|
|
statusBackground} = (UseUserProfileColorsModule).useUserProfileColors({theme: theme,
|
|
primaryColor: primaryColor, secondaryColor: secondaryColor});
|
|
if (user == null) {
|
|
return null;
|
|
}
|
|
if (currentUser == null) {
|
|
return null;
|
|
}
|
|
const onPressDisplayName_686392 = onPressDisplayName_68639;
|
|
const jsxRuntimeEnv0_11Binding = jsxRuntimeEnv0_11;
|
|
const value12 = ((Component) => <Component user={user} displayProfile={displayProfile} bannerHeight={value4} bannerAnimatedStyle={bannerAnimatedStyle} bannerImageAnimatedStyle={bannerImageAnimatedStyle} blurAnimatedProps={blurAnimatedProps} showBlur={showBlur} buttons={<View style={value3.bannerButtons}>{((Component) => <Component user={user} application={application} channel={channel} />)(BotUserProfileOverflowMenu)}</View>} />)(UserProfileOverscrollBanner);
|
|
const View2 = (ReanimatedRexport).View;
|
|
const value13 = ((Component) => <Component user={user} guildId={displayProfile?.guildId ?? undefined} backgroundColor={avatarBackground} statusStyle={{backgroundColor: statusBackground}} />)(importDefault(8510) /* metro dependency 8510: UserProfileAvatar */);
|
|
const items3 = [value3.profileContentWrapper];
|
|
items3[1] = value3.profileContent;
|
|
const PROFILE_CONTENT_WITHOUT_STATUS_TOP_PADDING2 = value9 != null ? 0 : PROFILE_CONTENT_WITHOUT_STATUS_TOP_PADDING;
|
|
items3[2] = {paddingTop: PROFILE_CONTENT_WITHOUT_STATUS_TOP_PADDING2,
|
|
paddingBottom: bottom + PROFILE_CONTENT_BOTTOM_PADDING};
|
|
const items4 = [
|
|
((Component) => <Component customStatusActivity={value9} hasCustomProfileTheme={primaryColor != null} onPressTruncatedStatus={onPressTruncatedStatus} style={value3.customStatusBubble} emojiOnlyStyle={value3.emojiOnlyCustomStatusBubble} />)(UserProfileCustomStatusBubble),
|
|
|
|
];
|
|
const primaryInfo = value3.primaryInfo;
|
|
const pronouns = displayProfile?.pronouns;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const items5 = [
|
|
<UserProfilePrimaryInfo
|
|
user={user}
|
|
guildId={guild_id}
|
|
displayName={value6}
|
|
pronouns={pronouns}
|
|
badges={value8}
|
|
badgeContainerBackground={containerBackground}
|
|
displayNameAccessibilityHint={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.y5MwJy)}
|
|
onPressDisplayName={onPressDisplayName_686392}
|
|
onPressUserTag={onPressDisplayName_686392}
|
|
onPressPronouns={onPressPronouns_68640}
|
|
showBadgeToastOnPress
|
|
/>,
|
|
];
|
|
items5[1] = ((Component) => <Component user={user} />)(importDefault(8817) /* metro dependency 8817: UserProfileMutualGuilds */);
|
|
const primaryButtons = value3.primaryButtons;
|
|
if (application != null) {
|
|
moduleValue5 = require(8063) /* metro dependency 8063: ApplicationInstallUtils */;
|
|
if (moduleValue5.canInstallApplication(application)) {
|
|
AddOrOpenAppButton = importDefault(8868) /* metro dependency 8868: AddOrOpenAppButton */;
|
|
var defaultImport14Props = {application: application, botUserId: user.id};
|
|
r33 = channel ?? undefined;
|
|
defaultImport14Props.channel = r33;
|
|
r33 = guild_id ?? undefined;
|
|
defaultImport14Props.guildId = r33;
|
|
r19 = <AddOrOpenAppButton {...defaultImport14Props} />;
|
|
} else {
|
|
r19 = undefined;
|
|
}
|
|
} else {
|
|
r19 = undefined;
|
|
}
|
|
const Button = (ButtonNativeModule).Button;
|
|
const object3 = {};
|
|
const ChatIcon = (ChatIconModule).ChatIcon;
|
|
const CONTROL_SECONDARY_TEXT_DEFAULT = (Native).colors.CONTROL_SECONDARY_TEXT_DEFAULT;
|
|
object3.icon = <ChatIcon size="sm" color={CONTROL_SECONDARY_TEXT_DEFAULT} />;
|
|
object3.text = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.zROXEV);
|
|
object3.variant = 'secondary';
|
|
object3.disabled = disableMessage;
|
|
object3.grow = true;
|
|
const formatToPlainString = intl.formatToPlainString;
|
|
const zFfSFQ = (require(1244) /* metro dependency 1244: indexNative */).t.zFfSFQ;
|
|
const object4 = {};
|
|
object4.name = (importDefault(3995) /* metro dependency 3995: UserUtils */).getName(user);
|
|
object3.accessibilityHint = Reflect.apply(formatToPlainString, intl, [zFfSFQ, object4]);
|
|
object3.onPress = function() {
|
|
trackUserProfileAction({action: 'SEND_MESSAGE'});
|
|
importDefault(dependencyMap[26]).hideActionSheet();
|
|
importDefault(dependencyMap[38]).popAll();
|
|
importDefault(dependencyMap[39]).openPrivateChannel({recipientIds: user.id});
|
|
};
|
|
items5[2] = (
|
|
<UserProfileTextButtonGroup
|
|
style={primaryButtons}
|
|
maxWidth={ACTION_SHEET_MAX_WIDTH}
|
|
primaryButton={r19}
|
|
secondaryButton={<Button {...object3} />}
|
|
/>
|
|
);
|
|
items4[1] = (
|
|
<View style={primaryInfo}>
|
|
{items5}
|
|
</View>
|
|
);
|
|
const items6 = [value3.card];
|
|
items6[1] = {backgroundColor: containerBackground};
|
|
const cards = value3.cards;
|
|
const items7 = [
|
|
((Component) => <Component user={user} currentUser={currentUser} guildId={guild_id} style={items6} />)(UserProfileActivity),
|
|
|
|
];
|
|
items7[1] = ((Component) => <Component userId={user.id} displayProfile={displayProfile} channel={channel} style={items6} />)(importDefault(8762) /* metro dependency 8762: UserProfileAboutMeCard */);
|
|
const value19 = guild_id != null;
|
|
if (value19) {
|
|
jsxRuntimeEnv0_11Binding2 = jsxRuntimeEnv0_11;
|
|
UserProfileRolesCard = importDefault(6792) /* metro dependency 6792: UserProfileRolesCard */;
|
|
id = user.id;
|
|
items8 = [
|
|
<UserProfileRolesCard
|
|
userId={id}
|
|
guildId={guild_id}
|
|
style={items6}
|
|
/>,
|
|
];
|
|
UserProfileModeratorActions = importDefault(10288) /* metro dependency 10288: UserProfileModeratorActions */;
|
|
id = channel?.id;
|
|
items8[1] = (
|
|
<UserProfileModeratorActions
|
|
user={user}
|
|
currentUser={currentUser}
|
|
guildId={guild_id}
|
|
channelId={id}
|
|
showUserProfile={showUserProfileActionSheet}
|
|
style={items6}
|
|
/>
|
|
);
|
|
r18 = (
|
|
<>
|
|
{items8}
|
|
</>
|
|
);
|
|
} else {
|
|
r18 = value19;
|
|
}
|
|
items7[2] = r18;
|
|
items7[3] = ((Component) => <Component userId={user.id} style={items6} onBack={showUserProfileActionSheet} />)(importDefault(10327) /* metro dependency 10327: UserProfileNote */);
|
|
items4[2] = (
|
|
<View style={cards}>
|
|
{items7}
|
|
</View>
|
|
);
|
|
return (
|
|
<>
|
|
{value12}
|
|
<View2 style={contentAnimatedStyle}>
|
|
{value13}
|
|
<View style={items3}>
|
|
{items4}
|
|
</View>
|
|
</View2>
|
|
</>
|
|
);
|
|
function BotUserProfileContentOnPressDisplayName() { // fn#68639, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8964:1363, owner: BotUserProfileContent.onPressDisplayName, offset: 0x01c5744c, size: 88 bytes, params: 1, frame: 14
|
|
trackUserProfileAction({action: 'COPY_USERNAME'});
|
|
(ClipboardUtilsNativeModule).copy(env0_3);
|
|
(ToastUtilsModule).presentUsernameCopied();
|
|
}
|
|
|
|
function BotUserProfileContentOnPressPronouns() { // fn#68640, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8964:1467, owner: BotUserProfileContent.onPressPronouns, offset: 0x01c574a4, size: 61 bytes, params: 1, frame: 12
|
|
trackUserProfileAction({action: 'PRESS_PRONOUNS'});
|
|
const value = environment.__proto__;
|
|
(ToastUtilsModule).presentUserPronouns();
|
|
}
|
|
|
|
function onPressTruncatedStatus() { // fn#68641, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8964:2132, owner: BotUserProfileContent.onPressTruncatedStatus, offset: 0x01c574e1, size: 139 bytes, params: 1, frame: 19
|
|
let value = environment.__proto__;
|
|
const value2 = undefined;
|
|
const defaultImport = importDefault(dependencyMap[26]);
|
|
const openLazy = defaultImport.openLazy;
|
|
value = require(dependencyMap[28]);
|
|
value = value(dependencyMap[27], dependencyMap.paths);
|
|
Reflect.apply(openLazy, defaultImport, [value, 'UserProfileCustomStatusActionSheet', {user: user, guildId: guild_id,
|
|
channelId: channel == null ? value2 : channel.id}, 'stack']);
|
|
return value2;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun68635, 8779, [31, 27, 1878, 6816, 6276, 33, 8496, 8752, 8760, 1585, 8514, 566, 4617, 3995, 6902,
|
|
8501, 8693, 8494, 8497, 6797, 3856, 8761, 8780, 4017, 8510, 8513, 4080, 8692, 1962, 8695, 1244, 8817, 8867,
|
|
8063, 8868, 4578, 6682, 697, 5080, 4603, 10210, 8762, 6792, 10288, 10327,
|
|
2]) /* metro module 8779, dependencies: [31, 27, 1878, 6816, 6276, 33, 8496, 8752, 8760, 1585, 8514, 566, 4617, 3995, 6902, 8501, 8693, 8494, 8497, 6797, 3856, 8761, 8780, 4017, 8510, 8513, 4080, 8692, 1962, 8695, 1244, 8817, 8867, 8063, 8868, 4578, 6682, 697, 5080, 4603, 10210, 8762, 6792, 10288, 10327, 2] */;
|