Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4759.js (118.4 MB)
82 lines
3.1 KiB
TypeScript
82 lines
3.1 KiB
TypeScript
// Module ID: 8282
|
|
// Function ID: 8283
|
|
// Name: UserProfileAvatar
|
|
// Dependencies: [19, 17, 8209, 7222, 21, 8267, 8283, 8216, 8286, 1114, 2]
|
|
// Exports: OpenableUserProfileAvatar
|
|
|
|
// Module 8282 (UserProfileAvatar)
|
|
import UserProfileSharedStylesDefault from "UserProfileSharedStyles" /* 8267 */;
|
|
import HeaderAvatarDefault from "HeaderAvatar" /* 8283 */;
|
|
import openUserProfileAvatarMediaViewerDefault from "openUserProfileAvatarMediaViewer" /* 8286 */;
|
|
import noop from "module_19" /* 19 */;
|
|
|
|
const require = fn;
|
|
const View = fn(17).View;
|
|
const TrackUserProfileActions = fn(8209).TrackUserProfileActions;
|
|
const AVATAR_SIZE_VARIANT = fn(7222).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);
|
|
};
|