decord/source/modules/lurker_mode/native/LurkerServerPreviewJoinButton.tsx

75 lines
3.2 KiB
TypeScript
Raw Normal View History

2026-07-29 08:29:29 +00:00
// Module ID: 11527
// Function ID: 11528
// Dependencies: [19, 1372, 1874, 3818, 676, 21, 589, 10095, 1306, 6692, 11528, 5105, 4600, 1236, 1416, 4028, 2]
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
// Module 11527
import importAllResult from "noop";
import ensureGuildLoaded from "ensureGuildLoaded";
import mergeGuildAvatar from "mergeGuildAvatar";
import initialize from "initialize";
2026-07-23 10:11:24 +00:00
import { JoinGuildSources } from "ME";
import { jsx } from "jsxProd";
const require = arg1;
2026-07-29 08:29:29 +00:00
let c3 = importAllResult;
2026-07-20 16:05:17 +00:00
const memoResult = importAllResult.memo(function LurkerServerPreviewJoinButton(guildId) {
guildId = guildId.guildId;
const joinSource = guildId.joinSource;
const onBeforeJoin = guildId.onBeforeJoin;
2026-07-29 08:29:29 +00:00
let stateFromStores;
2026-07-23 10:11:24 +00:00
let obj = guildId(onBeforeJoin[6]);
2026-07-29 08:29:29 +00:00
const items = [mergeGuildAvatar];
stateFromStores = obj.useStateFromStores(items, () => currentUser.getCurrentUser());
2026-07-20 16:05:17 +00:00
const items1 = [guildId, joinSource, onBeforeJoin];
const callback = stateFromStores.useCallback(() => {
2026-07-23 10:11:24 +00:00
const lurkingSourceForGuild = outer1_6.getLurkingSourceForGuild(guildId);
2026-07-20 16:05:17 +00:00
let type;
2026-07-29 08:29:29 +00:00
if (lurkingSourceForGuild != null) {
2026-07-20 16:05:17 +00:00
type = lurkingSourceForGuild.type;
}
2026-07-23 10:11:24 +00:00
if (type === outer1_7.DIRECTORY_ENTRY) {
const channel = outer1_4.getChannel(lurkingSourceForGuild.directoryChannelId);
2026-07-20 16:05:17 +00:00
if (null != channel) {
2026-07-23 10:11:24 +00:00
guildId = channel.getGuildId();
2026-07-20 16:05:17 +00:00
const result = guildId(onBeforeJoin[7]).setHubProgressActionComplete(guildId, guildId(onBeforeJoin[8]).HubProgressStep.JOIN_GUILD);
const obj2 = guildId(onBeforeJoin[7]);
}
}
const obj3 = guildId(onBeforeJoin[9]);
2026-07-29 08:29:29 +00:00
const tmp10 = joinSource;
const tmp11 = joinSource;
const tmp9 = onBeforeJoin;
2026-07-20 16:05:17 +00:00
obj3.trackJoinClicked(guildId, joinSource, joinSource(onBeforeJoin[10]).hasNavigatedAway(guildId));
2026-07-29 08:29:29 +00:00
if (onBeforeJoin != null) {
2026-07-20 16:05:17 +00:00
onBeforeJoin();
}
const obj4 = joinSource(onBeforeJoin[10]);
2026-07-29 08:29:29 +00:00
tmp11(tmp9[11]).joinGuild(guildId, { source: tmp10 });
2026-07-20 16:05:17 +00:00
}, items1);
if (null == stateFromStores) {
2026-07-29 08:29:29 +00:00
obj = { grow: true, variant: "primary", size: "md", text: null, onPress: null };
const intl = tmp(tmp2[13]).intl;
obj[3] = intl.string(tmp(tmp2[13]).t.VJlc0S);
obj[4] = callback;
return jsx(tmp(tmp2[12]).Button, { grow: true, variant: "primary", size: "md", text: null, onPress: null });
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
let obj2 = joinSource(tmp2[14]);
2026-07-20 16:05:17 +00:00
const userAvatarSource = obj2.getUserAvatarSource(stateFromStores, false);
2026-07-29 08:29:29 +00:00
const intl2 = tmp(tmp2[13]).intl;
obj = { usernameHook: null };
obj[0] = function usernameHook() {
return joinSource(onBeforeJoin[15]).getFormattedName(stateFromStores);
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
const obj1 = { grow: true, variant: "primary", size: "md", text: null, icon: null, onPress: null };
obj1[3] = intl2.formatToPlainString(tmp(tmp2[13]).t["5qtVhX"], obj);
obj2 = { source: null, variant: "entity" };
obj2[0] = userAvatarSource;
obj1[4] = jsx(tmp(tmp2[12]).Button.Icon, { source: null, variant: "entity" });
obj1[5] = callback;
return jsx(tmp(tmp2[12]).Button, { grow: true, variant: "primary", size: "md", text: null, icon: null, onPress: null });
2026-07-20 16:05:17 +00:00
}
});
2026-07-29 08:29:29 +00:00
let result = require("mergeGuildAvatar").fileFinishedImporting("modules/lurker_mode/native/LurkerServerPreviewJoinButton.tsx");
2026-07-20 16:05:17 +00:00
export default memoResult;