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

231 lines
8.7 KiB
TypeScript
Raw Normal View History

2026-07-28 08:39:19 +00:00
// Module ID: 12043
// Function ID: 92916
2026-07-23 10:11:24 +00:00
// Name: UserProfileApplicationWidgetCard
2026-07-28 08:39:19 +00:00
// Dependencies: [31, 27, 1922, 1194, 33, 4165, 689, 12044, 12045, 12135, 12136, 12137, 12138, 566, 12046, 1324, 5503, 5888, 8451, 8462, 12139, 12129, 5544, 5882, 11973, 4161, 1212, 2]
2026-07-23 10:11:24 +00:00
// Exports: default
2026-07-28 08:39:19 +00:00
// Module 12043 (UserProfileApplicationWidgetCard)
2026-07-23 10:11:24 +00:00
import result from "result";
import get_ActivityIndicator from "set";
import _isNativeReflectConstruct from "_isNativeReflectConstruct";
import closure_8 from "_isNativeReflectConstruct";
import jsxProd from "jsxProd";
import _createForOfIteratorHelperLoose from "_createForOfIteratorHelperLoose";
let closure_10;
let closure_4;
let closure_5;
let closure_6;
let closure_9;
const require = arg1;
({ Image: closure_4, Pressable: closure_5, View: closure_6 } = get_ActivityIndicator);
({ jsx: closure_9, jsxs: closure_10 } = jsxProd);
_createForOfIteratorHelperLoose = {};
_createForOfIteratorHelperLoose = { width: 16, height: 16, borderRadius: require("_createForOfIteratorHelperLoose").radii.xs, overflow: "hidden" };
_createForOfIteratorHelperLoose.appIcon = _createForOfIteratorHelperLoose;
let obj1 = { flexDirection: "row", alignItems: "center", gap: require("_createForOfIteratorHelperLoose").space.PX_4 };
_createForOfIteratorHelperLoose.header = obj1;
_createForOfIteratorHelperLoose.divider = { borderBottomWidth: 1, borderBottomColor: require("_createForOfIteratorHelperLoose").colors.BORDER_SUBTLE, marginBottom: require("_createForOfIteratorHelperLoose").space.PX_24 };
let obj3 = { flexDirection: "row", alignItems: "center", gap: require("_createForOfIteratorHelperLoose").space.PX_4 };
_createForOfIteratorHelperLoose.stillSyncing = obj3;
_createForOfIteratorHelperLoose = _createForOfIteratorHelperLoose.createStyles(_createForOfIteratorHelperLoose);
let obj2 = { borderBottomWidth: 1, borderBottomColor: require("_createForOfIteratorHelperLoose").colors.BORDER_SUBTLE, marginBottom: require("_createForOfIteratorHelperLoose").space.PX_24 };
let result = require("_isNativeReflectConstruct").fileFinishedImporting("modules/user_profile/native/UserProfileApplicationWidgetCard.tsx");
export default function UserProfileApplicationWidgetCard(userId) {
let cardStyle;
let hasIdentity;
let header;
let isFirstWidget;
let isLoading;
let layoutName;
let numberFormat;
let resolutionContext;
let resolveFieldValue;
let topConfig;
let widget;
userId = userId.userId;
({ widget, cardStyle, isFirstWidget } = userId);
if (isFirstWidget === undefined) {
isFirstWidget = false;
}
let stateFromStores;
let dependencyMap;
let tmp = _createForOfIteratorHelperLoose();
let obj = userId(566);
const items = [_isNativeReflectConstruct];
stateFromStores = obj.useStateFromStores(items, () => outer1_7.locale);
const items1 = [stateFromStores];
const memo = React.useMemo(() => userId(_undefined[14]).createCompactNumberFormat(stateFromStores), items1);
let obj1 = userId(566);
const items2 = [closure_8];
const stateFromStores1 = obj1.useStateFromStores(items2, () => outer1_8.getId() === userId);
const tmp5 = stateFromStores(1324)("UserProfileCard");
2026-07-28 08:39:19 +00:00
let obj2 = userId(5503);
2026-07-23 10:11:24 +00:00
const getOrFetchApplication = obj2.useGetOrFetchApplication(widget.applicationId);
let iconURL;
if (null != getOrFetchApplication) {
iconURL = getOrFetchApplication.getIconURL(16);
}
2026-07-28 08:39:19 +00:00
let obj4 = userId(5888);
2026-07-23 10:11:24 +00:00
let canonicalGameId;
if (null != getOrFetchApplication) {
canonicalGameId = getOrFetchApplication.getCanonicalGameId();
}
const data = obj4.useGame(canonicalGameId).data;
obj = { location: "UserProfileApplicationWidgetCard" };
let id;
if (null != data) {
id = data.id;
}
obj.applicationId = id;
2026-07-28 08:39:19 +00:00
obj.source = userId(8462).GameProfileSources.UserProfileApplicationWidget;
2026-07-23 10:11:24 +00:00
obj.sourceUserId = userId;
obj.trackEntryPointImpression = true;
2026-07-28 08:39:19 +00:00
const tmp8Result = stateFromStores(8451)(obj);
2026-07-23 10:11:24 +00:00
dependencyMap = tmp8Result;
2026-07-28 08:39:19 +00:00
const tmp11 = stateFromStores(12139)(userId, widget.applicationId);
2026-07-23 10:11:24 +00:00
const surfaceConfigs = tmp11.surfaceConfigs;
({ resolutionContext, isLoading, hasIdentity } = tmp11);
2026-07-28 08:39:19 +00:00
const tmp12 = surfaceConfigs[userId(undefined, 12129).ApplicationWidgetConfigSurface.WIDGET_TOP];
const tmp13 = surfaceConfigs[userId(undefined, 12129).ApplicationWidgetConfigSurface.WIDGET_BOTTOM];
2026-07-23 10:11:24 +00:00
let tmp14 = null;
if (null != iconURL) {
obj = {};
obj1 = { uri: iconURL };
obj.source = obj1;
obj.style = tmp.appIcon;
tmp14 = callback(closure_4, obj);
}
if (stateFromStores1) {
if (!isLoading) {
if (!hasIdentity) {
obj2 = { style: cardStyle };
2026-07-28 08:39:19 +00:00
let obj9 = userId(5882);
2026-07-23 10:11:24 +00:00
obj2.title = obj9.getWidgetTitle(widget);
obj2.titleLeadingIcon = tmp14;
const obj3 = { style: tmp.stillSyncing };
obj4 = { size: "xs", color: stateFromStores(689).colors.TEXT_MUTED };
2026-07-28 08:39:19 +00:00
const items3 = [callback(userId(11973).HourglassIcon, obj4), ];
2026-07-23 10:11:24 +00:00
const obj5 = { variant: "text-sm/medium", color: "text-muted" };
const intl = userId(1212).intl;
obj5.children = intl.string(userId(1212).t.z5K4Uv);
2026-07-28 08:39:19 +00:00
items3[1] = callback(userId(4161).Text, obj5);
2026-07-23 10:11:24 +00:00
obj3.children = items3;
obj2.children = callback2(closure_6, obj3);
2026-07-28 08:39:19 +00:00
return callback(stateFromStores(5544), obj2);
2026-07-23 10:11:24 +00:00
}
}
}
2026-07-28 08:39:19 +00:00
let obj13 = userId(12046);
2026-07-23 10:11:24 +00:00
const result = obj13.bindResolveFieldValue(resolutionContext);
const obj6 = {
style: tmp.header,
onPress() {
let tmp;
if (null != _undefined) {
tmp = _undefined();
}
return tmp;
},
disabled: null == tmp8Result,
accessibilityRole: "button"
};
2026-07-28 08:39:19 +00:00
let obj15 = userId(5882);
2026-07-23 10:11:24 +00:00
obj6.accessibilityLabel = obj15.getWidgetTitle(widget);
const items4 = [tmp14, ];
const obj7 = {};
let str2 = "text-sm/semibold";
if (tmp5) {
str2 = "text-sm/medium";
}
obj7.variant = str2;
let str3 = "text-default";
if (tmp5) {
str3 = "text-strong";
}
obj7.color = str3;
obj7.lineClamp = 1;
const tmp25 = callback2;
const tmp26 = closure_5;
const tmp27 = callback;
2026-07-28 08:39:19 +00:00
const tmp8 = stateFromStores(8451);
obj7.children = userId(5882).getWidgetTitle(widget);
items4[1] = tmp27(userId(4161).Text, obj7);
2026-07-23 10:11:24 +00:00
obj6.children = items4;
const obj8 = {};
let layout;
2026-07-28 08:39:19 +00:00
const obj18 = userId(5882);
2026-07-23 10:11:24 +00:00
if (null != tmp12) {
layout = tmp12.layout;
}
obj8.layoutName = layout;
obj8.header = tmp25(tmp26, obj6);
obj8.topConfig = tmp12;
obj8.resolveFieldValue = result;
obj8.numberFormat = memo;
({ layoutName, header, topConfig, resolveFieldValue, numberFormat } = obj8);
2026-07-24 07:16:23 +00:00
let tmp30 = null;
2026-07-23 10:11:24 +00:00
if (null != topConfig) {
2026-07-28 08:39:19 +00:00
if (userId(12044).ApplicationWidgetLayoutName.WIDGET_TOP_HERO === layoutName) {
2026-07-24 07:16:23 +00:00
obj9 = { header, topConfig, resolveFieldValue, numberFormat };
2026-07-28 08:39:19 +00:00
tmp30 = callback(stateFromStores(12045), obj9);
2026-07-23 10:11:24 +00:00
} else {
2026-07-24 07:16:23 +00:00
tmp30 = null;
2026-07-28 08:39:19 +00:00
if (userId(12044).ApplicationWidgetLayoutName.WIDGET_TOP_CONTAINED === layoutName) {
2026-07-23 10:11:24 +00:00
const obj10 = { header, topConfig, resolveFieldValue, numberFormat };
2026-07-28 08:39:19 +00:00
tmp30 = callback(stateFromStores(12135), obj10);
2026-07-23 10:11:24 +00:00
}
}
}
if (null != tmp13) {
layout = tmp13.layout;
}
2026-07-24 07:16:23 +00:00
let tmp41 = null;
2026-07-23 10:11:24 +00:00
if (null != tmp13) {
2026-07-28 08:39:19 +00:00
if (userId(12044).ApplicationWidgetLayoutName.WIDGET_BOTTOM_STATS === layout) {
2026-07-23 10:11:24 +00:00
const obj11 = { bottomConfig: tmp13, resolveFieldValue: result, numberFormat: memo };
2026-07-28 08:39:19 +00:00
tmp41 = callback(stateFromStores(12136), obj11);
} else if (userId(12044).ApplicationWidgetLayoutName.WIDGET_BOTTOM_PROGRESS === layout) {
2026-07-23 10:11:24 +00:00
const obj12 = { bottomConfig: tmp13, resolveFieldValue: result };
2026-07-28 08:39:19 +00:00
tmp41 = callback(stateFromStores(12137), obj12);
2026-07-23 10:11:24 +00:00
} else {
2026-07-24 07:16:23 +00:00
tmp41 = null;
2026-07-28 08:39:19 +00:00
if (userId(12044).ApplicationWidgetLayoutName.WIDGET_BOTTOM_COLLECTION === layout) {
2026-07-23 10:11:24 +00:00
obj13 = { bottomConfig: tmp13, resolveFieldValue: result };
2026-07-28 08:39:19 +00:00
tmp41 = callback(stateFromStores(12138), obj13);
2026-07-23 10:11:24 +00:00
}
}
}
2026-07-24 07:16:23 +00:00
let tmp53Result = null;
if (null != tmp30) {
tmp53Result = null;
if (null != tmp41) {
const obj14 = {};
const items5 = [cardStyle, ];
if (isFirstWidget) {
let layout1;
if (null != tmp12) {
layout1 = tmp12.layout;
}
2026-07-28 08:39:19 +00:00
isFirstWidget = layout1 === userId(12044).ApplicationWidgetLayoutName.WIDGET_TOP_HERO;
2026-07-24 07:16:23 +00:00
}
if (isFirstWidget) {
2026-07-28 08:39:19 +00:00
obj15 = { marginTop: userId(12045).HERO_IMAGE_UNCLIPPED_TOP_BLEED };
2026-07-24 07:16:23 +00:00
isFirstWidget = obj15;
}
items5[1] = isFirstWidget;
obj14.style = items5;
const items6 = [tmp30, , ];
const obj16 = { style: tmp.divider };
items6[1] = callback(closure_6, obj16);
items6[2] = tmp41;
obj14.children = items6;
2026-07-28 08:39:19 +00:00
tmp53Result = callback2(stateFromStores(5544), obj14);
2026-07-24 07:16:23 +00:00
const tmp53 = callback2;
2026-07-28 08:39:19 +00:00
const tmp56 = stateFromStores(5544);
2026-07-23 10:11:24 +00:00
}
}
2026-07-24 07:16:23 +00:00
return tmp53Result;
2026-07-23 10:11:24 +00:00
};