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

130 lines
4.9 KiB
TypeScript
Raw Normal View History

2026-09-02 09:53:35 +00:00
// Module ID: 8114
// Function ID: 8115
// Dependencies: [19, 17, 4470, 1991, 4569, 673, 21, 4478, 709, 1296, 586, 8115, 8084, 8116, 8117, 5076, 2]
2026-07-20 16:05:17 +00:00
2026-09-02 09:53:35 +00:00
// Module 8114
import ThemesDefault from "Themes" /* 709 */;
2026-08-24 06:08:38 +00:00
import { View } from "get ActivityIndicator" /* 17 */;
2026-09-01 10:26:29 +00:00
import closure_4 from "maybeApplyNoTextColorForLightCustomTheme" /* 4470 */;
2026-09-02 09:53:35 +00:00
import closure_5 from "trackCommunicationDisabled" /* 1991 */;
2026-09-01 10:26:29 +00:00
import closure_6 from "sortActivity" /* 4569 */;
2026-09-02 09:53:35 +00:00
import { ActivityTypes } from "ME" /* 673 */;
2026-08-24 06:08:38 +00:00
import { jsx } from "jsxProd" /* 21 */;
2026-09-01 10:26:29 +00:00
import createCacheKey from "createCacheKey" /* 4478 */;
2026-08-24 06:08:38 +00:00
import importAllResult from "noop" /* 19 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
let obj = { avatarStatusStyle: null };
2026-08-24 06:08:38 +00:00
obj = { backgroundColor: ThemesDefault.colors.BACKGROUND_SURFACE_HIGH };
2026-07-29 08:29:29 +00:00
obj[0] = obj;
let closure_9 = createCacheKey.createStyles(obj);
2026-08-24 06:08:38 +00:00
const forwardRefResult = importAllResult.forwardRef((animate) => {
2026-07-29 08:29:29 +00:00
({ user, guildId } = animate);
({ pendingAvatarSrc, style, onPress, size } = animate);
({ disableStatus, pendingAvatarDecoration, statusStyle } = animate);
2026-07-20 16:05:17 +00:00
if (size === undefined) {
2026-09-02 09:53:35 +00:00
size = guildId(1296).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;
2026-09-02 09:53:35 +00:00
obj1 = guildId(586);
2026-08-24 06:08:38 +00:00
const items = [closure_4];
2026-07-29 08:29:29 +00:00
const stateFromStores = obj1.useStateFromStores(items, () => useReducedMotion.useReducedMotion);
2026-09-02 09:53:35 +00:00
let obj2 = guildId(586);
2026-08-24 06:08:38 +00:00
const items1 = [closure_6];
2026-07-20 16:05:17 +00:00
const items2 = [id];
2026-08-24 06:08:38 +00:00
const stateFromStoresObject = obj2.useStateFromStoresObject(items1, () => ({ isMobileOnline: closure_1_6.isMobileOnline(id), isVROnline: closure_1_6.isVROnline(id), status: closure_1_6.getStatus(id), activities: closure_1_6.getActivities(id), customStatusActivity: closure_1_6.findActivity(id, (type) => type.type === constants.CUSTOM_STATUS) }), items2);
2026-07-20 16:05:17 +00:00
({ isMobileOnline, isVROnline, status, activities } = stateFromStoresObject);
2026-09-02 09:53:35 +00:00
let obj3 = guildId(586);
2026-08-24 06:08:38 +00:00
const items3 = [closure_5];
2026-07-29 08:29:29 +00:00
const stateFromStores1 = obj3.useStateFromStores(items3, () => {
2026-07-20 16:05:17 +00:00
let member = null;
if (null != guildId) {
2026-08-24 06:08:38 +00:00
member = closure_1_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-09-02 09:53:35 +00:00
let obj4 = guildId(8084);
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-09-02 09:53:35 +00:00
const tmp10 = id(8115);
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-09-02 09:53:35 +00:00
obj[5] = tmp9(8116)(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-09-02 09:53:35 +00:00
obj[7] = id(8115)(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-09-02 09:53:35 +00:00
obj = obj(8117);
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);
}
2026-09-02 09:53:35 +00:00
obj1.children = jsx(obj(1296).Avatar, obj3);
jsx(obj(5076).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-09-02 09:53:35 +00:00
const objResult = obj(8117);
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);
}
2026-09-02 09:53:35 +00:00
obj4.children = jsx(obj(1296).Avatar, obj6);
2026-07-29 08:29:29 +00:00
return <View ref={null} style={null} accessibilityRole="image" accessible />;
2026-07-20 16:05:17 +00:00
}
});
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/profile_customization/native/HeaderAvatar.tsx");
2026-07-20 16:05:17 +00:00
export default forwardRefResult;