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

122 lines
5.4 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 16155
// Function ID: 16156
2026-07-20 16:05:17 +00:00
// Name: UserProfileYourFriendsCard
2026-08-25 06:04:03 +00:00
// Dependencies: [32, 19, 17, 7265, 4034, 1922, 676, 21, 1297, 4380, 712, 589, 12545, 9229, 12, 1370, 4949, 1236, 4376, 5884, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-25 06:04:03 +00:00
// Module 16155 (UserProfileYourFriendsCard)
2026-08-24 06:08:38 +00:00
import ThemesDefault from "Themes" /* 712 */;
import closure_3 from "_slicedToArray" /* 32 */;
import closure_4 from "noop" /* 19 */;
import { View } from "get ActivityIndicator" /* 17 */;
2026-08-25 06:04:03 +00:00
import closure_6 from "recomputeAffinities" /* 7265 */;
import closure_7 from "markAllUserIdListsStale" /* 4034 */;
2026-08-24 06:08:38 +00:00
import closure_8 from "mergeGuildAvatar" /* 1922 */;
import { RelationshipTypes } from "ME" /* 676 */;
import jsxProd from "jsxProd" /* 21 */;
2026-08-25 06:04:03 +00:00
import createCacheKey from "createCacheKey" /* 4380 */;
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
const require = arg1;
({ jsx: c10, jsxs: unpackModuleId } = jsxProd);
2026-07-23 10:11:24 +00:00
let obj = { direction: require("Button").CutoutDirection.RIGHT, inset: -4 };
2026-07-20 16:05:17 +00:00
let closure_12 = Object.freeze(obj);
2026-07-29 08:29:29 +00:00
obj = { pressable: null, label: null, facepile: null, avatars: null };
2026-08-24 06:08:38 +00:00
obj = { flex: 1, flexDirection: "row", alignItems: "center", padding: 16, borderRadius: ThemesDefault.radii.lg };
2026-07-29 08:29:29 +00:00
obj[0] = obj;
obj[1] = { flex: 1 };
obj[2] = { flexDirection: "row", alignItems: "center", marginLeft: "auto", marginRight: 8 };
obj[3] = { flexDirection: "row" };
let closure_13 = createCacheKey.createStyles(obj);
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/user_profile/native/UserProfileYourFriendsCard.tsx");
2026-07-20 16:05:17 +00:00
export default function UserProfileYourFriendsCard(arg0) {
2026-07-29 08:29:29 +00:00
let _require;
let first;
2026-08-24 06:08:38 +00:00
dependencyMap = undefined;
2026-07-29 08:29:29 +00:00
let stateFromStoresArray;
let stateFromStoresArray1;
let gameRelationshipsByType;
2026-07-20 16:05:17 +00:00
({ navigateToFriends, style } = arg0);
2026-07-29 08:29:29 +00:00
let tmp = callback3();
_require = tmp;
2026-07-23 10:11:24 +00:00
const tmp2 = stateFromStoresArray(stateFromStoresArray1.useState([]), 2);
2026-07-29 08:29:29 +00:00
first = tmp2[0];
dependencyMap = tmp2[1];
let obj = _require(589);
2026-08-24 06:08:38 +00:00
let items = [closure_6];
2026-07-23 10:11:24 +00:00
stateFromStoresArray = obj.useStateFromStoresArray(items, () => {
2026-07-29 08:29:29 +00:00
userAffinities = userAffinities.getUserAffinities();
2026-07-20 16:05:17 +00:00
return userAffinities.map((otherUserId) => otherUserId.otherUserId);
});
2026-08-24 06:08:38 +00:00
const items1 = [closure_7];
2026-07-29 08:29:29 +00:00
stateFromStoresArray1 = _require(589).useStateFromStoresArray(items1, () => friendIDs.getFriendIDs());
const obj2 = _require(589);
2026-08-25 06:04:03 +00:00
gameRelationshipsByType = _require(12545).useGameRelationshipsByType(RelationshipTypes.FRIEND);
2026-07-23 10:11:24 +00:00
const effect = stateFromStoresArray1.useEffect(() => {
2026-08-25 06:04:03 +00:00
const userAffinitiesV2 = lib(9229).fetchUserAffinitiesV2();
2026-07-20 16:05:17 +00:00
}, []);
const items2 = [stateFromStoresArray, stateFromStoresArray1, gameRelationshipsByType];
2026-07-23 10:11:24 +00:00
const effect1 = stateFromStoresArray1.useEffect(() => {
2026-07-29 08:29:29 +00:00
const obj = first(12);
const tmp = first;
2026-08-24 06:08:38 +00:00
const found = first(12).chain(stateFromStoresArray).filter((arg0) => closure_4.includes(arg0));
2026-07-29 08:29:29 +00:00
const chainResult = first(12).chain(stateFromStoresArray);
2026-08-24 06:08:38 +00:00
const mapped = found.take(5).map(closure_1_8.getUser);
2026-07-20 16:05:17 +00:00
const takeResult = found.take(5);
2026-08-24 06:08:38 +00:00
const tmp3 = closure_1_8;
const tmp4 = lib;
let valueResult = mapped.filter(lib(1370).isNotNullish).value();
2026-07-20 16:05:17 +00:00
if (valueResult.length >= 5) {
2026-07-23 10:11:24 +00:00
dependencyMap(valueResult);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
const tmpResult = tmp(12);
const mapped1 = tmp(12).chain(gameRelationshipsByType).map((id) => id.id);
const chainResult1 = tmp(12).chain(gameRelationshipsByType);
2026-07-20 16:05:17 +00:00
const uniqResult = mapped1.uniq();
2026-07-29 08:29:29 +00:00
const mapped2 = mapped1.uniq().take(5 - valueResult.length).map(tmp3.getUser);
2026-07-20 16:05:17 +00:00
const takeResult1 = mapped1.uniq().take(5 - valueResult.length);
2026-08-11 06:20:06 +00:00
valueResult = mapped2.filter(tmp4(1370).isNotNullish).value();
2026-07-20 16:05:17 +00:00
const items = [];
HermesBuiltin.arraySpread(valueResult, HermesBuiltin.arraySpread(valueResult, 0));
2026-07-23 10:11:24 +00:00
dependencyMap(items);
2026-08-11 06:20:06 +00:00
const iter2 = mapped2.filter(tmp4(1370).isNotNullish);
2026-07-20 16:05:17 +00:00
}
}, items2);
const items3 = [first, , ];
({ avatars: arr4[1], facepile: arr4[2] } = tmp);
2026-07-23 10:11:24 +00:00
const memo = stateFromStoresArray1.useMemo(() => {
2026-08-24 06:08:38 +00:00
let obj = { style: lib.facepile, children: null };
2026-07-20 16:05:17 +00:00
obj = {
2026-08-24 06:08:38 +00:00
style: lib.avatars,
2026-07-20 16:05:17 +00:00
children: first.map((id) => {
2026-07-29 08:29:29 +00:00
let obj = { style: { transform: items }, children: null };
obj = { translateX: 4 * (closure_1.length - 1 - arg1) };
2026-07-23 10:11:24 +00:00
items = [obj];
2026-08-25 06:04:03 +00:00
obj = { user: id, guildId: "r", size: "ct", cutout: null };
2026-08-24 06:08:38 +00:00
obj[2] = closure_1_0(closure_1_2[8]).AvatarSizes.XSMALL;
2026-07-20 16:05:17 +00:00
let tmp3;
2026-07-29 08:29:29 +00:00
if (arg1 < closure_1.length - 1) {
2026-08-24 06:08:38 +00:00
tmp3 = closure_1_12;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[3] = tmp3;
2026-08-24 06:08:38 +00:00
obj[1] = closure_1_10(closure_1_0(closure_1_2[8]).CutoutableAvatarImage, obj);
return closure_1_10(closure_1_5, obj, id.id);
2026-07-20 16:05:17 +00:00
})
};
2026-08-24 06:08:38 +00:00
obj[1] = closure_1_10(gameRelationshipsByType, obj);
return closure_1_10(gameRelationshipsByType, obj);
2026-07-20 16:05:17 +00:00
}, items3);
2026-07-29 08:29:29 +00:00
obj = { accessibilityRole: "button", accessibilityLabel: null, onPress: null, style: null, activeOpacity: 0.8, children: null };
const intl = _require(1236).intl;
obj[1] = intl.string(_require(1236).t.TdEu5X);
obj[2] = navigateToFriends;
2026-07-20 16:05:17 +00:00
const items4 = [style, tmp.pressable];
2026-07-29 08:29:29 +00:00
obj[3] = items4;
obj = { accessibilityRole: "header", variant: "text-sm/semibold", color: "text-default", style: tmp.label, children: null };
const intl2 = _require(1236).intl;
obj[4] = intl2.string(_require(1236).t.TdEu5X);
2026-08-25 06:04:03 +00:00
const items5 = [callback(_require(4376).Text, obj), memo, callback(_require(5884).ChevronSmallRightIcon, { size: "sm" })];
2026-07-29 08:29:29 +00:00
obj[5] = items5;
2026-08-25 06:04:03 +00:00
return callback2(_require(4949).PressableOpacity, obj);
2026-07-20 16:05:17 +00:00
};