decord/source/modules/profile_customization/native/HeaderAvatar.tsx

142 lines
5.1 KiB
TypeScript
Raw Normal View History

2026-08-12 06:57:52 +00:00
// Module ID: 8344
// Function ID: 8345
// Dependencies: [19, 17, 4336, 1990, 4430, 676, 21, 4344, 712, 1297, 589, 8345, 8311, 8346, 8347, 4886, 2]
2026-07-20 16:05:17 +00:00
2026-08-12 06:57:52 +00:00
// Module 8344
2026-07-23 10:11:24 +00:00
import { View } from "get ActivityIndicator";
2026-07-29 08:29:29 +00:00
import maybeApplyNoTextColorForLightCustomTheme from "maybeApplyNoTextColorForLightCustomTheme";
import trackCommunicationDisabled from "trackCommunicationDisabled";
import sortActivity from "sortActivity";
2026-07-23 10:11:24 +00:00
import { ActivityTypes } from "ME";
import { jsx } from "jsxProd";
2026-07-29 08:29:29 +00:00
import createCacheKey from "createCacheKey";
import importAllResult from "noop";
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
let obj = { avatarStatusStyle: null };
obj = { backgroundColor: require("Themes").colors.BACKGROUND_SURFACE_HIGH };
obj[0] = obj;
let closure_9 = createCacheKey.createStyles(obj);
const forwardRefResult = require("noop").forwardRef((animate) => {
2026-07-20 16:05:17 +00:00
let activities;
let disableStatus;
2026-07-29 08:29:29 +00:00
let guildId;
2026-07-20 16:05:17 +00:00
let isMobileOnline;
let isVROnline;
let onPress;
let pendingAvatarDecoration;
2026-07-29 08:29:29 +00:00
let pendingAvatarSrc;
2026-07-20 16:05:17 +00:00
let size;
let status;
let statusStyle;
let style;
2026-07-29 08:29:29 +00:00
let user;
({ user, guildId } = animate);
({ pendingAvatarSrc, style, onPress, size } = animate);
({ disableStatus, pendingAvatarDecoration, statusStyle } = animate);
2026-07-20 16:05:17 +00:00
if (size === undefined) {
2026-07-29 08:29:29 +00:00
size = guildId(1297).AvatarSizes.XXLARGE;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let flag = animate.animate;
2026-07-20 16:05:17 +00:00
if (flag === undefined) {
flag = true;
}
2026-07-29 08:29:29 +00:00
const merged = Object.assign(animate, Object.create(null));
2026-07-23 10:11:24 +00:00
let id;
id = user.id;
2026-07-29 08:29:29 +00:00
let obj = guildId;
let avatarSource = dependencyMap;
let obj1 = guildId(589);
const items = [maybeApplyNoTextColorForLightCustomTheme];
const stateFromStores = obj1.useStateFromStores(items, () => useReducedMotion.useReducedMotion);
let obj2 = guildId(589);
const items1 = [sortActivity];
2026-07-20 16:05:17 +00:00
const items2 = [id];
2026-07-29 08:29:29 +00:00
const stateFromStoresObject = obj2.useStateFromStoresObject(items1, () => ({ isMobileOnline: outer1_6.isMobileOnline(id), isVROnline: outer1_6.isVROnline(id), status: outer1_6.getStatus(id), activities: outer1_6.getActivities(id), customStatusActivity: outer1_6.findActivity(id, (type) => type.type === constants.CUSTOM_STATUS) }), items2);
2026-07-20 16:05:17 +00:00
({ isMobileOnline, isVROnline, status, activities } = stateFromStoresObject);
2026-07-29 08:29:29 +00:00
let obj3 = guildId(589);
const items3 = [trackCommunicationDisabled];
const stateFromStores1 = obj3.useStateFromStores(items3, () => {
2026-07-20 16:05:17 +00:00
let member = null;
if (null != guildId) {
2026-07-29 08:29:29 +00:00
member = outer1_5.getMember(tmp, id);
2026-07-20 16:05:17 +00:00
}
return member;
});
2026-07-29 08:29:29 +00:00
const tmp4 = callback();
const tmp9 = id;
2026-08-12 06:57:52 +00:00
let obj4 = guildId(8311);
2026-07-29 08:29:29 +00:00
obj = { pendingValue: pendingAvatarDecoration, userValue: null, guildValue: null, guildId: null };
2026-07-20 16:05:17 +00:00
let avatarDecoration;
2026-07-29 08:29:29 +00:00
if (user != null) {
2026-07-20 16:05:17 +00:00
avatarDecoration = user.avatarDecoration;
}
2026-07-29 08:29:29 +00:00
obj[1] = avatarDecoration;
2026-07-20 16:05:17 +00:00
let avatarDecoration1;
2026-07-29 08:29:29 +00:00
if (stateFromStores1 != null) {
2026-07-20 16:05:17 +00:00
avatarDecoration1 = stateFromStores1.avatarDecoration;
}
2026-07-29 08:29:29 +00:00
obj[2] = avatarDecoration1;
obj[3] = guildId;
obj = { isMobileOnline, isVROnline, size, status: null, statusStyle: null, streaming: null, animate: null, avatarDecoration: null };
let tmp14 = null;
2026-08-12 06:57:52 +00:00
const tmp10 = id(8345);
2026-07-20 16:05:17 +00:00
if (!disableStatus) {
2026-07-29 08:29:29 +00:00
tmp14 = status;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[3] = tmp14;
const items4 = [tmp4.avatarStatusStyle, statusStyle];
obj[4] = items4;
2026-08-12 06:57:52 +00:00
obj[5] = tmp9(8346)(activities);
2026-07-20 16:05:17 +00:00
if (flag) {
flag = !stateFromStores;
}
2026-07-29 08:29:29 +00:00
obj[6] = flag;
2026-08-12 06:57:52 +00:00
obj[7] = id(8345)(obj4.getProfilePreviewValue(obj));
2026-07-20 16:05:17 +00:00
if (null != onPress) {
2026-07-29 08:29:29 +00:00
obj1 = { ref: null, onPress: null, onLongPress: null, style: null, activeOpacity: 0.8, accessibilityRole: "imagebutton" };
obj1[0] = arg1;
obj1[1] = onPress;
obj1[2] = onPress;
obj1[3] = style;
const merged1 = Object.assign(merged);
if (undefined !== pendingAvatarSrc) {
obj2 = { source: null };
2026-08-12 06:57:52 +00:00
obj = obj(8347);
2026-07-29 08:29:29 +00:00
avatarSource = obj.getAvatarSource(user, guildId, pendingAvatarSrc, stateFromStores);
obj2[0] = avatarSource;
obj = Object.assign(obj);
obj3 = obj2;
} else {
obj3 = { user: null, guildId: null };
obj3[0] = user;
obj3[1] = guildId;
const merged2 = Object.assign(obj);
}
obj1.children = jsx(obj(1297).Avatar, obj3);
2026-08-12 06:57:52 +00:00
jsx(obj(4886).PressableOpacity, { ref: null, onPress: null, onLongPress: null, style: null, activeOpacity: 0.8, accessibilityRole: "imagebutton" });
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
obj4 = { ref: null, style: null, accessibilityRole: "image", accessible: true };
obj4[0] = arg1;
obj4[1] = style;
const merged3 = Object.assign(merged);
if (undefined !== pendingAvatarSrc) {
const obj5 = { source: null };
2026-08-12 06:57:52 +00:00
const objResult = obj(8347);
2026-07-29 08:29:29 +00:00
obj5[0] = objResult.getAvatarSource(user, guildId, pendingAvatarSrc, stateFromStores);
const merged4 = Object.assign(obj);
let obj6 = obj5;
} else {
obj6 = { user: null, guildId: null };
obj6[0] = user;
obj6[1] = guildId;
const merged5 = Object.assign(obj);
}
obj4.children = jsx(obj(1297).Avatar, obj6);
return <View ref={null} style={null} accessibilityRole="image" accessible />;
2026-07-20 16:05:17 +00:00
}
});
2026-07-29 08:29:29 +00:00
const result = require("maybeApplyNoTextColorForLightCustomTheme").fileFinishedImporting("modules/profile_customization/native/HeaderAvatar.tsx");
2026-07-20 16:05:17 +00:00
export default forwardRefResult;