decord/source/modules/user_profile/native/UserProfileAvatar.tsx

83 lines
3.1 KiB
TypeScript
Raw Normal View History

// Module ID: 8384
// Function ID: 8385
// Name: UserProfileAvatar
// Dependencies: [19, 17, 8312, 7318, 21, 8369, 8385, 8319, 8388, 1115, 2]
2026-07-20 16:05:17 +00:00
// Exports: OpenableUserProfileAvatar
// Module 8384 (UserProfileAvatar)
import UserProfileSharedStylesDefault from "UserProfileSharedStyles" /* 8369 */;
import HeaderAvatarDefault from "HeaderAvatar" /* 8385 */;
import openUserProfileAvatarMediaViewerDefault from "openUserProfileAvatarMediaViewer" /* 8388 */;
import noop from "module_19" /* 19 */;
2026-07-23 10:11:24 +00:00
const require = fn;
const View = fn(17).View;
const TrackUserProfileActions = fn(8312).TrackUserProfileActions;
const AVATAR_SIZE_VARIANT = fn(7318).AVATAR_SIZE_VARIANT;
const jsxProd = fn(21);
({ jsx: closure_7, Fragment: closure_8, jsxs: closure_9 } = jsxProd);
const forwardRefResult = noop.forwardRef((backgroundColor, ref) => {
2026-07-20 16:05:17 +00:00
let size = backgroundColor.size;
if (size === undefined) {
size = AVATAR_SIZE_VARIANT;
}
const merged = Object.assign(backgroundColor, Object.assign({ backgroundColor: 0, size: 0 }));
const tmp2 = UserProfileSharedStylesDefault();
const obj = { children: null };
const obj2 = { style: null };
2026-07-20 16:05:17 +00:00
const items = [, , ];
2026-07-29 08:29:29 +00:00
({ avatarBackground: arr[0], avatarPosition: arr[1] } = tmp2);
2026-07-20 16:05:17 +00:00
items[2] = { backgroundColor: backgroundColor.backgroundColor };
obj2.style = items;
const items1 = [React5(View, obj2), ];
const obj3 = { ref, style: null, size };
const items2 = [, ];
2026-07-29 08:29:29 +00:00
({ avatar: arr3[0], avatarPosition: arr3[1] } = tmp2);
obj3.style = items2;
2026-07-20 16:05:17 +00:00
const merged1 = Object.assign(merged);
items1[1] = React5(HeaderAvatarDefault, obj3);
obj.children = items1;
return React7(React6, obj);
2026-07-20 16:05:17 +00:00
});
2026-07-29 08:29:29 +00:00
let c10 = forwardRefResult;
let size = fn(2);
const result = size.fileFinishedImporting("modules/user_profile/native/UserProfileAvatar.tsx");
2026-07-20 16:05:17 +00:00
export default forwardRefResult;
export const OpenableUserProfileAvatar = function OpenableUserProfileAvatar(animate) {
let flag = animate.animate;
if (flag === undefined) {
flag = true;
}
const user = animate.user;
const guildId = animate.guildId;
const merged = Object.assign(animate, Object.assign({ animate: 0, user: 0, guildId: 0 }));
2026-07-23 10:11:24 +00:00
let ref;
ref = ref.useRef(null);
const trackUserProfileAction = flag(guildId[7]).useUserProfileAnalyticsContext().trackUserProfileAction;
2026-07-29 08:29:29 +00:00
const tmp5 = null != user.avatar || user.hasAvatarForGuild(guildId);
2026-07-20 16:05:17 +00:00
const items = [flag, guildId, trackUserProfileAction, user];
const obj3 = { ref };
const callback = ref.useCallback(() => {
trackUserProfileAction({ action: TrackUserProfileActions.VIEW_AVATAR });
openUserProfileAvatarMediaViewerDefault({ user, guildId, animate: flag, originViewOrOriginLayout: ref.current });
2026-07-20 16:05:17 +00:00
}, items);
const merged1 = Object.assign(merged);
obj3.animate = flag;
obj3.user = user;
obj3.guildId = guildId;
2026-07-29 08:29:29 +00:00
let tmp10;
if (tmp5) {
tmp10 = callback;
2026-07-24 07:16:23 +00:00
}
obj3.onPress = tmp10;
2026-07-29 08:29:29 +00:00
if (tmp5) {
const intl = tmp3(tmp4[9]).intl;
let accessibilityLabel = intl.string(tmp3(tmp4[9]).t.xB7MI3);
2026-07-24 07:16:23 +00:00
} else {
accessibilityLabel = merged.accessibilityLabel;
}
obj3.accessibilityLabel = accessibilityLabel;
return closure_7(closure_10, obj3);
2026-07-20 16:05:17 +00:00
};