decord/source/modules/guild_themes/native/GuildThemeNuxActionSheet.tsx

175 lines
7.7 KiB
TypeScript
Raw Normal View History

2026-07-27 11:26:19 +00:00
// Module ID: 15061
// Function ID: 114711
2026-07-20 16:05:17 +00:00
// Name: GuildThemeNuxActionSheet
2026-07-27 11:26:19 +00:00
// Dependencies: [5, 57, 31, 27, 3948, 4017, 1345, 33, 3, 4131, 689, 15062, 4063, 566, 4099, 1212, 5187, 15063, 4127, 7596, 7595, 1273, 4544, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-07-27 11:26:19 +00:00
// Module 15061 (GuildThemeNuxActionSheet)
2026-07-23 10:11:24 +00:00
import _isNativeReflectConstruct from "_isNativeReflectConstruct";
import _slicedToArray from "_slicedToArray";
import result from "result";
import { View } from "get ActivityIndicator";
import closure_7 from "_isNativeReflectConstruct";
import closure_8 from "_isNativeReflectConstruct";
import { ContentDismissActionType } from "ContentDismissActionType";
import jsxProd from "jsxProd";
import importDefaultResult from "get ActivityIndicator";
import _createForOfIteratorHelperLoose from "_createForOfIteratorHelperLoose";
let closure_10;
let closure_11;
const require = arg1;
({ jsx: closure_10, jsxs: closure_11 } = jsxProd);
2026-07-20 16:05:17 +00:00
importDefaultResult = new importDefaultResult("GuildThemeNuxActionSheet");
2026-07-23 10:11:24 +00:00
_createForOfIteratorHelperLoose = {};
_createForOfIteratorHelperLoose = { padding: require("_createForOfIteratorHelperLoose").space.PX_16, paddingTop: require("_createForOfIteratorHelperLoose").space.PX_8, paddingBottom: 0 };
_createForOfIteratorHelperLoose.container = _createForOfIteratorHelperLoose;
_createForOfIteratorHelperLoose.title = { textAlign: "center", marginBottom: require("_createForOfIteratorHelperLoose").space.PX_8 };
let obj1 = { textAlign: "center", marginBottom: require("_createForOfIteratorHelperLoose").space.PX_8 };
_createForOfIteratorHelperLoose.description = { textAlign: "center", marginBottom: require("_createForOfIteratorHelperLoose").space.PX_24 };
let obj2 = { textAlign: "center", marginBottom: require("_createForOfIteratorHelperLoose").space.PX_24 };
_createForOfIteratorHelperLoose.options = { marginBottom: require("_createForOfIteratorHelperLoose").space.PX_12 };
let obj3 = { marginBottom: require("_createForOfIteratorHelperLoose").space.PX_12 };
_createForOfIteratorHelperLoose.warning = { marginBottom: require("_createForOfIteratorHelperLoose").space.PX_12 };
let obj4 = { marginBottom: require("_createForOfIteratorHelperLoose").space.PX_12 };
_createForOfIteratorHelperLoose.footer = { gap: require("_createForOfIteratorHelperLoose").space.PX_8 };
_createForOfIteratorHelperLoose = _createForOfIteratorHelperLoose.createStyles(_createForOfIteratorHelperLoose);
let obj5 = { gap: require("_createForOfIteratorHelperLoose").space.PX_8 };
const result = require("result").fileFinishedImporting("modules/guild_themes/native/GuildThemeNuxActionSheet.tsx");
2026-07-20 16:05:17 +00:00
export default function GuildThemeNuxActionSheet(guildId) {
2026-07-23 10:11:24 +00:00
let _isNativeReflectConstruct;
let _slicedToArray;
2026-07-20 16:05:17 +00:00
let tmp5;
let tmp7;
guildId = guildId.guildId;
const markAsDismissed = guildId.markAsDismissed;
2026-07-23 10:11:24 +00:00
const tmp = _createForOfIteratorHelperLoose();
2026-07-27 11:26:19 +00:00
let tmp2 = callback2(React.useState(guildId(15062).getInitialGuildThemeNuxSelection), 2);
2026-07-20 16:05:17 +00:00
const first = tmp2[0];
2026-07-23 10:11:24 +00:00
const dependencyMap = tmp2[1];
[tmp5, _isNativeReflectConstruct] = callback2(React.useState(null), 2);
2026-07-20 16:05:17 +00:00
const tmp4 = callback2(React.useState(null), 2);
2026-07-23 10:11:24 +00:00
[tmp7, _slicedToArray] = callback2(React.useState(false), 2);
React = React.useRef(false);
2026-07-25 08:10:48 +00:00
const tmp8 = first === guildId(4063).GuildThemeSourcePreference.PERSONAL;
2026-07-20 16:05:17 +00:00
const View = tmp8;
2026-07-23 10:11:24 +00:00
let obj = guildId(566);
const items = [stateFromStores];
stateFromStores = obj.useStateFromStores(items, () => stateFromStores.getGuildId());
let obj1 = guildId(566);
const items1 = [callback1];
2026-07-20 16:05:17 +00:00
const items2 = [guildId];
const items3 = [guildId, stateFromStores];
const stateFromStores1 = obj1.useStateFromStores(items1, () => {
const guildThemeSnapshot = callback1.getGuildThemeSnapshot(guildId);
let tmp2 = null;
if (null != guildThemeSnapshot) {
tmp2 = null;
if (guildThemeSnapshot.enabled) {
const themeSettings = guildThemeSnapshot.themeSettings;
tmp2 = null;
if (null != themeSettings) {
tmp2 = themeSettings;
}
}
}
return tmp2;
}, items2);
const effect = React.useEffect(() => {
if (stateFromStores !== guildId) {
2026-07-25 08:10:48 +00:00
markAsDismissed(4099).hideActionSheet("GuildThemeNuxActionSheet");
const obj = markAsDismissed(4099);
2026-07-20 16:05:17 +00:00
}
}, items3);
const items4 = [markAsDismissed];
const fn = (arg0) => {
if (!ref.current) {
ref.current = true;
markAsDismissed(arg0);
}
};
const callback = React.useCallback((arg0) => {
2026-07-23 10:11:24 +00:00
callback(null);
dependencyMap(arg0);
2026-07-20 16:05:17 +00:00
}, []);
2026-07-23 10:11:24 +00:00
callback1 = React.useCallback(fn, items4);
2026-07-20 16:05:17 +00:00
// CreateGeneratorClosureLongIndex (0x67)
const items5 = [guildId, tmp8, markAsDismissed, stateFromStores];
const items6 = [callback1];
2026-07-23 10:11:24 +00:00
callback2 = React.useCallback(callback(fn), items5);
2026-07-20 16:05:17 +00:00
const callback3 = React.useCallback(() => {
2026-07-23 10:11:24 +00:00
callback1(outer1_9.USER_DISMISS);
2026-07-20 16:05:17 +00:00
}, items6);
2026-07-23 10:11:24 +00:00
const intl = guildId(1212).intl;
2026-07-20 16:05:17 +00:00
const string = intl.string;
2026-07-23 10:11:24 +00:00
const t = guildId(1212).t;
2026-07-20 16:05:17 +00:00
if (tmp8) {
let stringResult = string(t.cvoikF);
} else {
2026-07-23 10:11:24 +00:00
stringResult = string(t["cY+Oob"]);
2026-07-20 16:05:17 +00:00
}
obj = { startExpanded: true };
2026-07-23 10:11:24 +00:00
const intl2 = guildId(1212).intl;
obj.dismissAccessibilityLabel = intl2.string(guildId(1212).t.cpT0Cq);
2026-07-20 16:05:17 +00:00
obj.onDismiss = callback3;
obj.contentStyles = tmp.container;
2026-07-27 11:26:19 +00:00
const items7 = [callback3(markAsDismissed(15063), { themeSettings: stateFromStores1, isPersonal: tmp8 }), , , , , , ];
2026-07-23 10:11:24 +00:00
obj = { accessibilityRole: "header", variant: "heading-xl/semibold", color: "mobile-text-heading-primary", style: tmp.title };
const intl3 = guildId(1212).intl;
obj.children = intl3.string(guildId(1212).t.Q9zFy9);
2026-07-25 08:10:48 +00:00
items7[1] = callback3(guildId(4127).Text, obj);
2026-07-23 10:11:24 +00:00
obj1 = { variant: "text-md/normal", color: "text-default", style: tmp.description };
const intl4 = guildId(1212).intl;
obj1.children = intl4.string(guildId(1212).t.XLpBLj);
2026-07-25 08:10:48 +00:00
items7[2] = callback3(guildId(4127).Text, obj1);
2026-07-20 16:05:17 +00:00
const obj2 = { style: tmp.options };
const obj3 = { hasIcons: false, value: first, onChange: callback };
const obj4 = {};
2026-07-23 10:11:24 +00:00
const intl5 = guildId(1212).intl;
obj4.label = intl5.string(guildId(1212).t.aN3RNQ);
2026-07-25 08:10:48 +00:00
obj4.value = guildId(4063).GuildThemeSourcePreference.GUILD;
const items8 = [callback3(guildId(7595).TableRadioRow, obj4), ];
2026-07-20 16:05:17 +00:00
const obj5 = {};
2026-07-23 10:11:24 +00:00
const intl6 = guildId(1212).intl;
obj5.label = intl6.string(guildId(1212).t.js8y7t);
2026-07-25 08:10:48 +00:00
obj5.value = guildId(4063).GuildThemeSourcePreference.PERSONAL;
items8[1] = callback3(guildId(7595).TableRadioRow, obj5);
2026-07-20 16:05:17 +00:00
obj3.children = items8;
2026-07-25 08:10:48 +00:00
obj2.children = callback4(guildId(7596).TableRadioGroup, obj3);
2026-07-20 16:05:17 +00:00
items7[3] = callback3(View, obj2);
let tmp18 = null;
if (tmp8) {
const obj6 = { style: tmp.warning };
2026-07-23 10:11:24 +00:00
const obj7 = { messageType: guildId(1273).HelpMessageTypes.WARNING, borderRadius: markAsDismissed(689).radii.md };
const intl7 = guildId(1212).intl;
obj7.children = intl7.string(guildId(1212).t.tTHQAy);
obj6.children = callback3(guildId(1273).HelpMessage, obj7);
2026-07-20 16:05:17 +00:00
tmp18 = callback3(View, obj6);
}
items7[4] = tmp18;
let tmp24 = null;
if (null != tmp5) {
const obj8 = { style: tmp.warning };
2026-07-23 10:11:24 +00:00
const obj9 = { messageType: guildId(1273).HelpMessageTypes.ERROR, borderRadius: markAsDismissed(689).radii.md, children: tmp5 };
obj8.children = callback3(guildId(1273).HelpMessage, obj9);
2026-07-20 16:05:17 +00:00
tmp24 = callback3(View, obj8);
}
items7[5] = tmp24;
const obj10 = { style: tmp.footer };
const obj11 = { text: stringResult };
let str = "primary";
if (tmp8) {
str = "secondary";
}
obj11.variant = str;
obj11.loading = tmp7;
obj11.disabled = tmp7;
obj11.onPress = callback2;
2026-07-25 08:10:48 +00:00
obj10.children = callback3(guildId(4544).Button, obj11);
2026-07-20 16:05:17 +00:00
items7[6] = callback3(View, obj10);
obj.children = items7;
2026-07-23 10:11:24 +00:00
return callback4(guildId(5187).BottomSheet, obj);
2026-07-20 16:05:17 +00:00
};
export const GUILD_THEME_NUX_ACTION_SHEET_KEY = "GuildThemeNuxActionSheet";