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

123 lines
4.4 KiB
TypeScript
Raw Normal View History

// Module ID: 14544
// Function ID: 14545
2026-08-03 11:20:01 +00:00
// Name: UserProfileBadgesEditButton
// Dependencies: [19, 17, 21, 4481, 709, 11130, 7102, 4448, 14545, 2008, 11131, 1233, 14543, 11122, 4477, 2]
2026-08-03 11:20:01 +00:00
// Exports: default
// Module 14544 (UserProfileBadgesEditButton)
2026-09-02 09:53:35 +00:00
import ThemesDefault from "Themes" /* 709 */;
2026-08-24 06:08:38 +00:00
import closure_3 from "noop" /* 19 */;
import get_ActivityIndicator from "get ActivityIndicator" /* 17 */;
import jsxProd from "jsxProd" /* 21 */;
import createCacheKey from "createCacheKey" /* 4481 */;
2026-08-03 11:20:01 +00:00
const require = arg1;
({ Image: c4, View: c5 } = get_ActivityIndicator);
2026-08-25 06:04:03 +00:00
({ jsx: closure_6, jsxs: error } = jsxProd);
2026-08-26 06:04:24 +00:00
createCacheKey = { content: null, badge: null, overflowCount: null };
2026-08-24 06:08:38 +00:00
createCacheKey = { flexGrow: 1, flexShrink: 1, flexDirection: "row", alignItems: "center", gap: ThemesDefault.space.PX_4 };
2026-08-03 11:20:01 +00:00
createCacheKey[0] = createCacheKey;
createCacheKey[1] = { width: 32, height: 32 };
2026-08-26 06:04:24 +00:00
createCacheKey[2] = { marginLeft: 2 };
2026-08-25 06:04:03 +00:00
let closure_8 = createCacheKey.createStyles(createCacheKey);
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/user_profile/native/UserProfileBadgesEditButton.tsx");
2026-08-03 11:20:01 +00:00
2026-08-13 07:00:46 +00:00
export default function UserProfileBadgesEditButton(arg0) {
({ badges, catalogBadges } = arg0);
2026-08-03 11:20:01 +00:00
let _require;
2026-08-14 17:33:39 +00:00
let analyticsLocations;
2026-08-25 06:04:03 +00:00
dependencyMap = undefined;
2026-08-26 06:04:24 +00:00
const tmp = callback();
2026-08-03 11:20:01 +00:00
_require = tmp;
let obj = _require(11130);
2026-08-03 11:20:01 +00:00
const isBadgeManagementEnabled = obj.useIsBadgeManagementEnabled({ location: "UserProfileBadgesEditButton" });
analyticsLocations = analyticsLocations(7102)().analyticsLocations;
2026-08-14 17:33:39 +00:00
[][0] = analyticsLocations;
2026-08-03 11:20:01 +00:00
if (isBadgeManagementEnabled) {
dependencyMap = tmp2(11131).getLegacyIconUrlByBadgeId(badges);
2026-08-13 07:00:46 +00:00
let length;
if (catalogBadges != null) {
length = catalogBadges.length;
}
if (length == null) {
length = badges.length;
}
const substr = badges.slice(0, tmp2(11131).MAX_DISPLAYED_PROFILE_BADGES);
2026-08-13 07:00:46 +00:00
let substr1;
if (catalogBadges != null) {
substr1 = catalogBadges.slice(0, tmp2(11131).MAX_DISPLAYED_PROFILE_BADGES);
2026-08-13 07:00:46 +00:00
}
if (substr1 == null) {
substr1 = null;
}
const _Math = Math;
const diff = length - Math.min(length, tmp2(11131).MAX_DISPLAYED_PROFILE_BADGES);
2026-08-13 07:00:46 +00:00
let mapped;
if (substr1 != null) {
mapped = substr1.map((name) => name.name);
}
if (mapped == null) {
mapped = substr.map((description) => description.description);
}
2026-09-02 09:53:35 +00:00
const intl = tmp2(1233).intl;
2026-08-13 07:00:46 +00:00
obj = { badge_names: null, overflow_count: null };
obj[0] = mapped.join(", ");
obj[1] = diff;
const tmp2Result = tmp2(11131);
2026-08-26 06:04:24 +00:00
obj = { label: null, content: null, accessibilityValue: null, onPress: null };
2026-09-02 09:53:35 +00:00
const intl2 = tmp2(1233).intl;
obj[0] = intl2.string(tmp2(1233).t.l6w3Vj);
2026-08-26 06:04:24 +00:00
obj1 = { style: null, "aria-hidden": true, children: null };
obj1[0] = tmp.content;
2026-08-13 07:00:46 +00:00
if (null != substr1) {
2026-08-25 06:04:03 +00:00
let mapped1 = substr1.map((badge_id) => {
const value = closure_2.get(badge_id.badge_id);
if (null != value) {
let obj = { style: null, source: null };
obj[0] = lib.badge;
obj = { uri: null };
obj[0] = value;
obj[1] = obj;
let tmp6 = closure_1_6(closure_1_4, obj, badge_id.badge_id);
} else {
obj = { badge: null, size: 32, style: null };
obj[0] = badge_id;
obj[2] = lib.badge;
2026-08-26 06:04:24 +00:00
tmp6 = closure_1_6(analyticsLocations(closure_2[13]), obj, badge_id.badge_id);
2026-08-13 07:00:46 +00:00
}
2026-08-25 06:04:03 +00:00
return tmp6;
});
} else {
mapped1 = substr.map((id) => {
let obj = { style: lib.badge, source: null };
2026-08-26 06:04:24 +00:00
obj = { uri: lib(closure_2[10]).getProfileBadgeIconUrl(id) };
2026-08-25 06:04:03 +00:00
obj[1] = obj;
return closure_1_6(closure_1_4, obj, id.id);
2026-08-13 07:00:46 +00:00
});
}
const items = [mapped1, ];
2026-08-26 06:04:24 +00:00
let tmp14Result = diff > 0;
if (tmp14Result) {
const obj2 = { variant: "text-md/normal", color: "mobile-text-heading-primary", style: null, children: null };
obj2[2] = tmp.overflowCount;
2026-08-13 07:00:46 +00:00
const _HermesInternal = HermesInternal;
2026-08-26 06:04:24 +00:00
obj2[3] = "+" + diff;
tmp14Result = tmp14(tmp2(4477).Text, obj2);
2026-08-13 07:00:46 +00:00
}
2026-08-26 06:04:24 +00:00
items[1] = tmp14Result;
obj1[2] = items;
obj[1] = closure_7(closure_5, obj1);
let tmp19;
2026-08-13 07:00:46 +00:00
if (mapped.length > 0) {
2026-08-26 06:04:24 +00:00
const obj3 = { text: null };
obj3[0] = formatToPlainStringResult;
tmp19 = obj3;
2026-08-03 11:20:01 +00:00
}
2026-08-26 06:04:24 +00:00
obj[2] = tmp19;
obj[3] = tmp5;
return closure_6(tmp2(14543).UserProfileEditFormButton, obj);
2026-08-13 07:00:46 +00:00
} else {
return null;
2026-08-03 11:20:01 +00:00
}
};