74 lines
3.2 KiB
TypeScript
74 lines
3.2 KiB
TypeScript
// Module ID: 11045
|
|
// Function ID: 11046
|
|
// Name: GuildNSFW
|
|
// Dependencies: [109, 19, 1910, 1221, 21, 589, 4619, 4621, 5338, 7942, 7944, 1236, 11046, 2]
|
|
// Exports: default
|
|
|
|
// Module 11045 (GuildNSFW)
|
|
import GatedContentDefault from "GatedContent" /* 11046 */;
|
|
import closure_4 from "_objectWithoutProperties" /* 109 */;
|
|
import closure_5 from "noop" /* 19 */;
|
|
import closure_6 from "createGuildRecordFromRust" /* 1910 */;
|
|
import { AgeGateSource } from "result" /* 1221 */;
|
|
import { jsx } from "jsxProd" /* 21 */;
|
|
|
|
const require = arg1;
|
|
let closure_3 = ["modalType"];
|
|
let result = require("set").fileFinishedImporting("components_native/warnings/GuildNSFW.tsx");
|
|
|
|
export default function GuildNSFW(channelId) {
|
|
const _require = channelId;
|
|
let obj = _require(589);
|
|
const items = [closure_6];
|
|
const stateFromStores = obj.useStateFromStores(items, () => closure_1_6.getGuild(channelId.guildId));
|
|
obj1 = _require(4619);
|
|
const ageGateVerifyContentForGuild = obj1.useAgeGateVerifyContentForGuild(stateFromStores);
|
|
const modalType = ageGateVerifyContentForGuild.modalType;
|
|
let obj2 = _require(4621);
|
|
const maybePerformReactiveCheckForSource = obj2.useMaybePerformReactiveCheckForSource(AgeGateSource.NSFW_SERVER);
|
|
obj = {};
|
|
const callback = React.useCallback(() => {
|
|
let obj = callback(7942);
|
|
obj = { entryPoint: channelId(7944).AgeVerificationModalEntryPoint.NSFW_GUILD };
|
|
const result = obj.showAgeVerificationGetStartedModal(obj);
|
|
}, []);
|
|
const merged = Object.assign(callback(ageGateVerifyContentForGuild, closure_3));
|
|
let id;
|
|
if (stateFromStores != null) {
|
|
id = stateFromStores.id;
|
|
}
|
|
function handleDisagree() {
|
|
closure_1_1(closure_1_2[8]).nsfwReturnToSafety(channelId.guildId);
|
|
if (channelId.onReturnToSafety != null) {
|
|
onReturnToSafety();
|
|
}
|
|
}
|
|
obj.guildId = id;
|
|
obj.channelId = channelId.channelId;
|
|
const intl = tmp(1236).intl;
|
|
obj.disagreement = intl.string(_require(1236).t["/g10LC"]);
|
|
if (_require(7944).NsfwSpaceWarningModalType.NSFW_CHANNEL_AGE_VERIFY !== modalType) {
|
|
if (tmp(7944).NsfwSpaceWarningModalType.GUILD_LARGE_SERVER !== modalType) {
|
|
if (tmp(7944).NsfwSpaceWarningModalType.NSFW_CHANNEL_UNDERAGE === modalType) {
|
|
obj = { modalType: null, disagreementButtonVariant: "primary", onDisagree: null };
|
|
obj[0] = modalType;
|
|
obj[2] = handleDisagree;
|
|
const merged1 = Object.assign(obj);
|
|
return jsx(GatedContentDefault, { modalType: null, disagreementButtonVariant: "primary", onDisagree: null });
|
|
} else {
|
|
obj1 = { modalType: null, onAgree: null, onDisagree: null };
|
|
obj1[0] = modalType;
|
|
obj1[1] = function handleAgree() {
|
|
closure_1_1(closure_1_2[8]).nsfwAgree(channelId.guildId);
|
|
};
|
|
obj1[2] = handleDisagree;
|
|
const merged2 = Object.assign(obj);
|
|
return jsx(GatedContentDefault, { modalType: null, onAgree: null, onDisagree: null });
|
|
}
|
|
}
|
|
}
|
|
obj2 = { modalType, onAgree: callback, onDisagree: handleDisagree };
|
|
const tmp5 = callback(ageGateVerifyContentForGuild, closure_3);
|
|
const merged3 = Object.assign(obj);
|
|
return jsx(GatedContentDefault, { modalType, onAgree: callback, onDisagree: handleDisagree });
|
|
};
|