137 lines
4.8 KiB
TypeScript
137 lines
4.8 KiB
TypeScript
// Module ID: 13009
|
|
// Function ID: 13010
|
|
// Name: TimestampBadge
|
|
// Dependencies: [19, 17, 1074, 21, 4560, 9035, 7739, 5106, 10888, 9916, 9228, 13010, 13011, 576, 13012, 8135, 5089, 4556, 11658, 2]
|
|
// Exports: EpisodeBadge, PartyBadge, TimestampBadge
|
|
|
|
// Module 13009 (TimestampBadge)
|
|
import noopAll from "noop" /* 19 */;
|
|
import ThemesDefault from "Themes" /* 576 */;
|
|
import isEmbeddedActivityDefault from "isEmbeddedActivity" /* 7739 */;
|
|
import calculateTimestampDurations from "calculateTimestampDurations" /* 8135 */;
|
|
import useTimestampTickedNow from "useTimestampTickedNow" /* 13010 */;
|
|
import shouldShowActivityTimeBarDefault from "shouldShowActivityTimeBar" /* 13011 */;
|
|
import { View } from "get ActivityIndicator" /* 17 */;
|
|
import { ActivityTypes } from "ME" /* 1074 */;
|
|
import jsxProd from "jsxProd" /* 21 */;
|
|
import createCacheKey from "createCacheKey" /* 4560 */;
|
|
|
|
require = arg1;
|
|
noopAll;
|
|
({ jsx: c5, jsxs: closure_6 } = jsxProd);
|
|
let closure_7 = createCacheKey.createStyles({ container: { display: "flex", flexDirection: "row", alignItems: "center", gap: 4 }, bold: { fontWeight: "bold" } });
|
|
const result = require("set").fileFinishedImporting("modules/user_profile/native/UserProfileActivityBadges.tsx");
|
|
|
|
export const TimestampBadge = function TimestampBadge(activity) {
|
|
activity = activity.activity;
|
|
const tmp = callback3();
|
|
let obj = useTimestampTickedNow;
|
|
const timestamps = activity.timestamps;
|
|
let start;
|
|
if (timestamps != null) {
|
|
start = timestamps.start;
|
|
}
|
|
if (start == null) {
|
|
start = activity.created_at;
|
|
}
|
|
if (null != start) {
|
|
if (!shouldShowActivityTimeBarDefault(activity)) {
|
|
const timestamps2 = activity.timestamps;
|
|
let end;
|
|
if (timestamps2 != null) {
|
|
end = timestamps2.end;
|
|
}
|
|
const timestamps3 = activity.timestamps;
|
|
let flag;
|
|
if (timestamps3 != null) {
|
|
flag = timestamps3.isCountDown;
|
|
}
|
|
if (flag == null) {
|
|
flag = false;
|
|
}
|
|
let flag2 = flag;
|
|
if (flag) {
|
|
flag2 = null != end;
|
|
}
|
|
if (flag2) {
|
|
flag2 = end > obj.useTimestampTickedNow().now;
|
|
}
|
|
if (flag2 === undefined) {
|
|
flag2 = false;
|
|
}
|
|
if (flag2) {
|
|
let GameControllerIcon = tmp2(9035).HourglassIcon;
|
|
} else if (tmp10(7739)(activity)) {
|
|
GameControllerIcon = tmp2(5106).AppsIcon;
|
|
} else if (activity.type === ActivityTypes.WATCHING) {
|
|
GameControllerIcon = tmp2(10888).TvIcon;
|
|
} else if (activity.type === tmp6.LISTENING) {
|
|
GameControllerIcon = tmp2(9916).MusicIcon;
|
|
} else {
|
|
GameControllerIcon = tmp2(9228).GameControllerIcon;
|
|
}
|
|
obj = { style: null, children: null };
|
|
obj[0] = tmp.container;
|
|
obj = { size: "xxs", color: null };
|
|
obj[1] = tmp10(576).colors.TEXT_FEEDBACK_POSITIVE;
|
|
const items = [callback(GameControllerIcon, obj), ];
|
|
obj1 = { entry: null, style: null };
|
|
const obj2 = { start: null, end: null, isCountDown: null };
|
|
obj2[0] = start;
|
|
obj2[1] = end;
|
|
obj2[2] = flag;
|
|
obj1[0] = obj2;
|
|
obj1[1] = tmp.bold;
|
|
items[1] = callback(tmp2(13012).ActiveTimestamp, obj1);
|
|
obj[1] = items;
|
|
return callback2(View, obj);
|
|
}
|
|
}
|
|
return null;
|
|
};
|
|
export const PartyBadge = function PartyBadge(activity) {
|
|
activity = activity.activity;
|
|
if (!isEmbeddedActivityDefault(activity)) {
|
|
if (null != activity.party) {
|
|
const richGameStateBadgeText = calculateTimestampDurations.getRichGameStateBadgeText(activity.state, activity.party);
|
|
let tmp8 = null;
|
|
if (null != richGameStateBadgeText) {
|
|
let obj = { style: null, children: null };
|
|
obj[0] = tmp.container;
|
|
obj = { size: "xxs", color: null };
|
|
obj[1] = ThemesDefault.colors.TEXT_MUTED;
|
|
const items = [callback(tmp9(5089).GroupIcon, obj), ];
|
|
obj = { variant: "text-sm/medium", color: "text-muted", children: null };
|
|
obj[2] = richGameStateBadgeText;
|
|
items[1] = callback(tmp9(4556).Text, obj);
|
|
obj[1] = items;
|
|
tmp8 = callback2(View, obj);
|
|
}
|
|
return tmp8;
|
|
}
|
|
}
|
|
return null;
|
|
};
|
|
export const EpisodeBadge = function EpisodeBadge(activity) {
|
|
let obj = calculateTimestampDurations;
|
|
const assets = activity.activity.assets;
|
|
let large_text;
|
|
if (assets != null) {
|
|
large_text = assets.large_text;
|
|
}
|
|
const episodeBadgeText = obj.getEpisodeBadgeText(large_text);
|
|
let tmp6 = null;
|
|
if (null != episodeBadgeText) {
|
|
obj = { style: null, children: null };
|
|
obj[0] = tmp.container;
|
|
obj = { size: "xxs", color: null };
|
|
obj[1] = ThemesDefault.colors.TEXT_MUTED;
|
|
const items = [callback(tmp2(11658).TopicsIcon, obj), ];
|
|
obj1 = { variant: "text-sm/medium", color: "text-muted", children: null };
|
|
obj1[2] = episodeBadgeText;
|
|
items[1] = callback(tmp2(4556).Text, obj1);
|
|
obj[1] = items;
|
|
tmp6 = callback2(View, obj);
|
|
}
|
|
return tmp6;
|
|
};
|