decord/source/modules/premium/powerups/native/GuildPowerupsChannelRow.tsx

138 lines
5.3 KiB
TypeScript
Raw Normal View History

// Module ID: 16312
// Function ID: 16313
// Name: GuildPowerupsChannelRow
// Dependencies: [19, 17, 10246, 21, 12624, 6711, 576, 1178, 4636, 16267, 16106, 7260, 12620, 12639, 12508, 12608, 7285, 7259, 1114, 2428, 16313, 12420, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
// Module 16312 (GuildPowerupsChannelRow)
import nativeDefault from "native" /* 576 */;
import LayerContext from "LayerContext" /* 7260 */;
import AnalyticsLocationDefault from "AnalyticsLocation" /* 7285 */;
import openGuildPowerupsModalDefault from "openGuildPowerupsModal" /* 12608 */;
import GuildPowerupsNotification from "GuildPowerupsNotification" /* 12624 */;
import SidebarCoachmarkOverlay from "SidebarCoachmarkOverlay" /* 16106 */;
import useGuildPowerupsCoachmarkDefault from "useGuildPowerupsCoachmark" /* 16267 */;
import noop from "module_19" /* 19 */;
2026-07-20 16:05:17 +00:00
require = fn;
2026-07-20 16:05:17 +00:00
function GuildPowerupsChannelRowIndicator(indicator) {
indicator = indicator.indicator;
if (null == indicator) {
return null;
} else {
const type = indicator.type;
if (GuildPowerupsNotification.GuildPowerupNotificationIndicatorType.WARNING === type) {
const obj2 = { color: nativeDefault.colors.STATUS_WARNING, size: "sm" };
return hasOwnProperty(tmp4(6711).CircleErrorIcon, obj2);
} else if (tmp4(12624).GuildPowerupNotificationIndicatorType.UNREAD === type) {
const obj = { value: indicator.count, isMentionLowImportance: true };
return hasOwnProperty(tmp4(1178).Badge, obj);
2026-07-20 16:05:17 +00:00
} else {
return null;
}
}
}
function GuildPowerupsCoachmarkHost(arg0) {
({ targetRef, guildId, popout } = arg0);
2026-08-24 06:08:38 +00:00
useGuildPowerupsCoachmarkDefault(targetRef, guildId, popout);
2026-07-20 16:05:17 +00:00
return null;
}
function GuildPowerupsCoachmark(arg0) {
({ targetRef, guildId, popout } = arg0);
const context = noop.useContext(SidebarCoachmarkOverlay.SidebarCoachmarkOverlayContext);
const tmp5 = hasOwnProperty(GuildPowerupsCoachmarkHost, { targetRef, guildId, popout });
2026-07-29 08:29:29 +00:00
let tmp4Result = tmp5;
2026-07-20 16:05:17 +00:00
if (null != context) {
const obj = { value: context, children: tmp5 };
tmp4Result = hasOwnProperty(LayerContext.LayerContext.Provider, obj);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp4Result;
2026-07-20 16:05:17 +00:00
}
const View = fn(17).View;
const jsxProd = fn(21);
({ jsx: hasOwnProperty, jsxs: metroRequire } = jsxProd);
const createStyles = fn(4636);
let obj2 = { container: { marginVertical: fn(10246).CHANNEL_MARGIN_VERTICAL, marginHorizontal: 8, borderRadius: nativeDefault.radii.md } };
let closure_8 = createStyles.createStyles(obj2);
const size = fn(2);
const result = size.fileFinishedImporting("modules/premium/powerups/native/GuildPowerupsChannelRow.tsx");
2026-07-20 16:05:17 +00:00
export default function GuildPowerupsChannelRow(guildId) {
guildId = guildId.guildId;
2026-07-23 10:11:24 +00:00
let dismissNewBadgeIfShown;
const ref = noop.useRef(null);
const tmp5 = dismissNewBadgeIfShown(12620)(guildId);
2026-07-20 16:05:17 +00:00
let indicator;
let obj = noop;
const tmp = closure_8();
2026-07-29 08:29:29 +00:00
if (tmp5 != null) {
indicator = tmp5.indicator;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let tmp8 = null != indicator;
if (!tmp8) {
2026-07-20 16:05:17 +00:00
let popout;
2026-07-29 08:29:29 +00:00
if (tmp5 != null) {
popout = tmp5.popout;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp8 = null != popout;
2026-07-20 16:05:17 +00:00
}
const tmp6Result = dismissNewBadgeIfShown(12639)(guildId, tmp8);
2026-07-29 08:29:29 +00:00
dismissNewBadgeIfShown = tmp6Result.dismissNewBadgeIfShown;
2026-07-20 16:05:17 +00:00
let showUnread;
2026-07-29 08:29:29 +00:00
if (tmp5 != null) {
showUnread = tmp5.showUnread;
}
const ChannelModes = guildId(12508).ChannelModes;
2026-07-29 08:29:29 +00:00
if (true === showUnread) {
let DEFAULT = ChannelModes.UNREAD_IMPORTANT;
let tmp14 = tmp13;
} else {
DEFAULT = ChannelModes.DEFAULT;
tmp14 = tmp13;
2026-07-20 16:05:17 +00:00
}
const items = [guildId, dismissNewBadgeIfShown];
2026-07-29 08:29:29 +00:00
const callback = obj.useCallback(() => {
2026-07-20 16:05:17 +00:00
dismissNewBadgeIfShown();
const obj = { guildId, analyticsLocation: AnalyticsLocationDefault.GUILD_POWERUPS_CHANNEL_LIST_ROW };
openGuildPowerupsModalDefault(obj);
2026-07-20 16:05:17 +00:00
}, items);
const obj2 = { ref, collapsable: false, children: null };
const obj3 = { targetRef: ref, guildId, popout: null };
2026-08-04 08:36:32 +00:00
let popout1;
2026-07-29 08:29:29 +00:00
if (tmp5 != null) {
popout1 = tmp5.popout;
2026-07-20 16:05:17 +00:00
}
obj3.popout = popout1;
const items1 = [closure_5(GuildPowerupsCoachmark, obj3), ];
const obj4 = { onPress: callback, style: tmp.container, accessible: true, mode: DEFAULT, unread: true === showUnread, accessibilityLabel: null, accessibilityState: null, name: null, icon: null, channelInfo: null };
2026-08-04 08:36:32 +00:00
const tmp17 = closure_6;
const tmp18 = View;
const tmp6 = dismissNewBadgeIfShown(12639);
const intl = tmp14(1114).intl;
obj4.accessibilityLabel = intl.string(dismissNewBadgeIfShown(2428).yv3DJJ);
obj4.accessibilityState = { selected: false };
const obj5 = { name: null, mode: null };
const intl2 = tmp14(1114).intl;
obj5.name = intl2.string(dismissNewBadgeIfShown(2428).yv3DJJ);
obj5.mode = DEFAULT;
obj4.name = closure_5(tmp14(12508).BaseChannelName, obj5);
const tmp3Result = dismissNewBadgeIfShown(12508);
obj4.icon = closure_5(tmp14(12508).BaseChannelIcon, { mode: DEFAULT, IconComponent: tmp14(16313).BoostTier2Icon });
2026-07-29 08:29:29 +00:00
if (tmp6Result.showNewBadgeOnRow) {
let tmp16Result = tmp16(tmp14(12420).NewBadge, {});
2026-07-20 16:05:17 +00:00
} else {
let indicator1;
2026-07-29 08:29:29 +00:00
if (tmp5 != null) {
indicator1 = tmp5.indicator;
2026-07-20 16:05:17 +00:00
}
const obj7 = { indicator: indicator1 };
tmp16Result = tmp16(GuildPowerupsChannelRowIndicator, obj7);
2026-07-20 16:05:17 +00:00
}
const obj8 = { zIndex: 1, children: null };
obj4.channelInfo = tmp16Result;
items1[1] = closure_5(tmp3Result, obj4);
obj2.children = items1;
obj8.children = tmp17(tmp18, obj2);
return closure_5(tmp14(7259).LayerScope, obj8);
2026-07-20 16:05:17 +00:00
};