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

138 lines
4.8 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 12154
// Function ID: 12155
2026-07-20 16:05:17 +00:00
// Name: TimestampBadge
2026-08-24 06:08:38 +00:00
// Dependencies: [19, 17, 676, 21, 4668, 11451, 7297, 8013, 9938, 9943, 9467, 12155, 12156, 712, 12157, 8387, 6922, 4739, 10879, 2]
2026-07-20 16:05:17 +00:00
// Exports: EpisodeBadge, PartyBadge, TimestampBadge
2026-08-24 06:08:38 +00:00
// Module 12154 (TimestampBadge)
import noopAll from "noop" /* 19 */;
import ThemesDefault from "Themes" /* 712 */;
import isEmbeddedActivityDefault from "isEmbeddedActivity" /* 7297 */;
import calculateTimestampDurations from "calculateTimestampDurations" /* 8387 */;
import useTimestampTickedNow from "useTimestampTickedNow" /* 12155 */;
import shouldShowActivityTimeBarDefault from "shouldShowActivityTimeBar" /* 12156 */;
import { View } from "get ActivityIndicator" /* 17 */;
import { ActivityTypes } from "ME" /* 676 */;
import jsxProd from "jsxProd" /* 21 */;
import createCacheKey from "createCacheKey" /* 4668 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
noopAll;
2026-07-29 08:29:29 +00:00
({ jsx: c5, jsxs: closure_6 } = jsxProd);
let closure_7 = createCacheKey.createStyles({ container: { display: "flex", flexDirection: "row", alignItems: "center", gap: 4 }, bold: { fontWeight: "bold" } });
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/user_profile/native/UserProfileActivityBadges.tsx");
2026-07-20 16:05:17 +00:00
export const TimestampBadge = function TimestampBadge(activity) {
activity = activity.activity;
const tmp = callback3();
2026-08-24 06:08:38 +00:00
let obj = useTimestampTickedNow;
2026-07-20 16:05:17 +00:00
const timestamps = activity.timestamps;
let start;
2026-07-29 08:29:29 +00:00
if (timestamps != null) {
2026-07-20 16:05:17 +00:00
start = timestamps.start;
}
2026-07-29 08:29:29 +00:00
if (start == null) {
2026-07-20 16:05:17 +00:00
start = activity.created_at;
}
if (null != start) {
2026-08-24 06:08:38 +00:00
if (!shouldShowActivityTimeBarDefault(activity)) {
2026-07-20 16:05:17 +00:00
const timestamps2 = activity.timestamps;
let end;
2026-07-29 08:29:29 +00:00
if (timestamps2 != null) {
2026-07-20 16:05:17 +00:00
end = timestamps2.end;
}
const timestamps3 = activity.timestamps;
2026-07-29 08:29:29 +00:00
let flag;
if (timestamps3 != null) {
flag = timestamps3.isCountDown;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (flag == null) {
flag = false;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let flag2 = flag;
2026-07-20 16:05:17 +00:00
if (flag) {
2026-07-29 08:29:29 +00:00
flag2 = null != end;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (flag2) {
flag2 = end > obj.useTimestampTickedNow().now;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (flag2 === undefined) {
flag2 = false;
}
if (flag2) {
2026-08-24 06:08:38 +00:00
let GameControllerIcon = tmp2(11451).HourglassIcon;
} else if (tmp10(7297)(activity)) {
GameControllerIcon = tmp2(8013).AppsIcon;
2026-07-20 16:05:17 +00:00
} else if (activity.type === ActivityTypes.WATCHING) {
2026-08-24 06:08:38 +00:00
GameControllerIcon = tmp2(9938).TvIcon;
2026-07-29 08:29:29 +00:00
} else if (activity.type === tmp6.LISTENING) {
2026-08-24 06:08:38 +00:00
GameControllerIcon = tmp2(9943).MusicIcon;
2026-07-20 16:05:17 +00:00
} else {
2026-08-24 06:08:38 +00:00
GameControllerIcon = tmp2(9467).GameControllerIcon;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj = { style: null, children: null };
obj[0] = tmp.container;
obj = { size: "xxs", color: null };
obj[1] = tmp10(712).colors.TEXT_FEEDBACK_POSITIVE;
2026-07-20 16:05:17 +00:00
const items = [callback(GameControllerIcon, obj), ];
2026-08-24 06:08:38 +00:00
obj1 = { entry: null, style: null };
2026-07-29 08:29:29 +00:00
const obj2 = { start: null, end: null, isCountDown: null };
obj2[0] = start;
obj2[1] = end;
obj2[2] = flag;
obj1[0] = obj2;
obj1[1] = tmp.bold;
2026-08-24 06:08:38 +00:00
items[1] = callback(tmp2(12157).ActiveTimestamp, obj1);
2026-07-29 08:29:29 +00:00
obj[1] = items;
2026-07-20 16:05:17 +00:00
return callback2(View, obj);
}
}
return null;
};
export const PartyBadge = function PartyBadge(activity) {
activity = activity.activity;
2026-08-24 06:08:38 +00:00
if (!isEmbeddedActivityDefault(activity)) {
2026-07-20 16:05:17 +00:00
if (null != activity.party) {
2026-08-24 06:08:38 +00:00
const richGameStateBadgeText = calculateTimestampDurations.getRichGameStateBadgeText(activity.state, activity.party);
2026-07-29 08:29:29 +00:00
let tmp8 = null;
2026-07-20 16:05:17 +00:00
if (null != richGameStateBadgeText) {
2026-07-29 08:29:29 +00:00
let obj = { style: null, children: null };
obj[0] = tmp.container;
obj = { size: "xxs", color: null };
2026-08-24 06:08:38 +00:00
obj[1] = ThemesDefault.colors.TEXT_MUTED;
const items = [callback(tmp9(6922).GroupIcon, obj), ];
2026-07-29 08:29:29 +00:00
obj = { variant: "text-sm/medium", color: "text-muted", children: null };
obj[2] = richGameStateBadgeText;
2026-08-24 06:08:38 +00:00
items[1] = callback(tmp9(4739).Text, obj);
2026-07-29 08:29:29 +00:00
obj[1] = items;
tmp8 = callback2(View, obj);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp8;
2026-07-20 16:05:17 +00:00
}
}
return null;
};
export const EpisodeBadge = function EpisodeBadge(activity) {
2026-08-24 06:08:38 +00:00
let obj = calculateTimestampDurations;
2026-07-20 16:05:17 +00:00
const assets = activity.activity.assets;
let large_text;
2026-07-29 08:29:29 +00:00
if (assets != null) {
2026-07-20 16:05:17 +00:00
large_text = assets.large_text;
}
const episodeBadgeText = obj.getEpisodeBadgeText(large_text);
2026-07-29 08:29:29 +00:00
let tmp6 = null;
2026-07-20 16:05:17 +00:00
if (null != episodeBadgeText) {
2026-07-29 08:29:29 +00:00
obj = { style: null, children: null };
obj[0] = tmp.container;
obj = { size: "xxs", color: null };
2026-08-24 06:08:38 +00:00
obj[1] = ThemesDefault.colors.TEXT_MUTED;
const items = [callback(tmp2(10879).TopicsIcon, obj), ];
obj1 = { variant: "text-sm/medium", color: "text-muted", children: null };
2026-07-29 08:29:29 +00:00
obj1[2] = episodeBadgeText;
2026-08-24 06:08:38 +00:00
items[1] = callback(tmp2(4739).Text, obj1);
2026-07-29 08:29:29 +00:00
obj[1] = items;
tmp6 = callback2(View, obj);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp6;
2026-07-20 16:05:17 +00:00
};