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

125 lines
5.5 KiB
TypeScript
Raw Normal View History

2026-07-29 08:29:29 +00:00
// Module ID: 15636
// Function ID: 15637
2026-07-20 16:05:17 +00:00
// Name: UserProfileYourFriendsCard
2026-07-29 08:29:29 +00:00
// Dependencies: [32, 19, 17, 5945, 3826, 1874, 676, 21, 1297, 4189, 712, 589, 12056, 8816, 12, 1351, 4717, 1236, 4185, 5565, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-07-29 08:29:29 +00:00
// Module 15636 (UserProfileYourFriendsCard)
2026-07-23 10:11:24 +00:00
import _slicedToArray from "_slicedToArray";
2026-07-29 08:29:29 +00:00
import ChevronSmallRightIcon from "ChevronSmallRightIcon";
import { View } from "getSystemLocale";
import recomputeAffinities from "recomputeAffinities";
import upsertRelationship from "upsertRelationship";
import mergeGuildAvatar from "mergeGuildAvatar";
2026-07-23 10:11:24 +00:00
import { RelationshipTypes } from "ME";
import jsxProd from "jsxProd";
2026-07-29 08:29:29 +00:00
import createCacheKey from "createCacheKey";
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
let c10;
let unpackModuleId;
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 };
obj = { flex: 1, flexDirection: "row", alignItems: "center", padding: 16, borderRadius: require("Themes").radii.lg };
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-07-23 10:11:24 +00:00
const result = require("get ActivityIndicator").fileFinishedImporting("modules/user_profile/native/UserProfileYourFriendsCard.tsx");
2026-07-20 16:05:17 +00:00
export default function UserProfileYourFriendsCard(arg0) {
let navigateToFriends;
let style;
2026-07-29 08:29:29 +00:00
let _require;
let first;
let dependencyMap;
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);
let items = [recomputeAffinities];
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-07-29 08:29:29 +00:00
const items1 = [upsertRelationship];
stateFromStoresArray1 = _require(589).useStateFromStoresArray(items1, () => friendIDs.getFriendIDs());
const obj2 = _require(589);
gameRelationshipsByType = _require(12056).useGameRelationshipsByType(RelationshipTypes.FRIEND);
2026-07-23 10:11:24 +00:00
const effect = stateFromStoresArray1.useEffect(() => {
2026-07-29 08:29:29 +00:00
const userAffinitiesV2 = _undefined(8816).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;
const found = first(12).chain(stateFromStoresArray).filter((arg0) => ChevronSmallRightIcon.includes(arg0));
const chainResult = first(12).chain(stateFromStoresArray);
2026-07-23 10:11:24 +00:00
const mapped = found.take(5).map(outer1_8.getUser);
2026-07-20 16:05:17 +00:00
const takeResult = found.take(5);
2026-07-29 08:29:29 +00:00
const tmp3 = outer1_8;
const tmp4 = _undefined;
let valueResult = mapped.filter(_undefined(1351).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-07-29 08:29:29 +00:00
valueResult = mapped2.filter(tmp4(1351).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-07-29 08:29:29 +00:00
const iter2 = mapped2.filter(tmp4(1351).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-07-29 08:29:29 +00:00
let obj = { style: _undefined.facepile, children: null };
2026-07-20 16:05:17 +00:00
obj = {
2026-07-29 08:29:29 +00:00
style: _undefined.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-07-29 08:29:29 +00:00
obj = { user: id, guildId: "r", size: "mode", cutout: "Array" };
obj[2] = outer1_0(outer1_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) {
tmp3 = outer1_12;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[3] = tmp3;
obj[1] = outer1_10(outer1_0(outer1_2[8]).CutoutableAvatarImage, obj);
return outer1_10(outer1_5, obj, id.id);
2026-07-20 16:05:17 +00:00
})
};
2026-07-29 08:29:29 +00:00
obj[1] = outer1_10(gameRelationshipsByType, obj);
2026-07-23 10:11:24 +00:00
return outer1_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);
const items5 = [callback(_require(4185).Text, obj), memo, callback(_require(5565).ChevronSmallRightIcon, { size: "sm" })];
obj[5] = items5;
return callback2(_require(4717).PressableOpacity, obj);
2026-07-20 16:05:17 +00:00
};