// Module ID: 8384 // Function ID: 8385 // Name: UserProfileAvatar // Dependencies: [19, 17, 8312, 7318, 21, 8369, 8385, 8319, 8388, 1115, 2] // 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 */; 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) => { 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 }; const items = [, , ]; ({ avatarBackground: arr[0], avatarPosition: arr[1] } = tmp2); items[2] = { backgroundColor: backgroundColor.backgroundColor }; obj2.style = items; const items1 = [React5(View, obj2), ]; const obj3 = { ref, style: null, size }; const items2 = [, ]; ({ avatar: arr3[0], avatarPosition: arr3[1] } = tmp2); obj3.style = items2; const merged1 = Object.assign(merged); items1[1] = React5(HeaderAvatarDefault, obj3); obj.children = items1; return React7(React6, obj); }); let c10 = forwardRefResult; let size = fn(2); const result = size.fileFinishedImporting("modules/user_profile/native/UserProfileAvatar.tsx"); 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 })); let ref; ref = ref.useRef(null); const trackUserProfileAction = flag(guildId[7]).useUserProfileAnalyticsContext().trackUserProfileAction; const tmp5 = null != user.avatar || user.hasAvatarForGuild(guildId); 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 }); }, items); const merged1 = Object.assign(merged); obj3.animate = flag; obj3.user = user; obj3.guildId = guildId; let tmp10; if (tmp5) { tmp10 = callback; } obj3.onPress = tmp10; if (tmp5) { const intl = tmp3(tmp4[9]).intl; let accessibilityLabel = intl.string(tmp3(tmp4[9]).t.xB7MI3); } else { accessibilityLabel = merged.accessibilityLabel; } obj3.accessibilityLabel = accessibilityLabel; return closure_7(closure_10, obj3); };