decord/source/modules/guilds_bar/native/GuildsBarFolderSettingsModal.tsx

141 lines
5.1 KiB
TypeScript
Raw Normal View History

2026-07-28 08:39:19 +00:00
// Module ID: 14920
// Function ID: 113675
2026-07-20 16:05:17 +00:00
// Name: GuildFolderSettingsScene
2026-07-28 08:39:19 +00:00
// Dependencies: [57, 31, 5005, 14921, 33, 6186, 7611, 1212, 1273, 14922, 5121, 566, 14919, 5552, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-07-28 08:39:19 +00:00
// Module 14920 (GuildFolderSettingsScene)
2026-07-23 10:11:24 +00:00
import _slicedToArray from "_slicedToArray";
import result from "result";
import _isNativeReflectConstruct from "_isNativeReflectConstruct";
import { DEFAULT_FOLDER_COLOR } from "DEFAULT_FOLDER_COLOR";
import jsxProd from "jsxProd";
let closure_7;
let closure_8;
const require = arg1;
2026-07-20 16:05:17 +00:00
function GuildFolderSettingsScene(arg0) {
let color;
let name;
let onColorChange;
let onNameChange;
({ name, onNameChange, color, onColorChange } = arg0);
let obj = {};
obj = {};
2026-07-23 10:11:24 +00:00
const intl = require(1212) /* getSystemLocale */.intl;
obj.title = intl.string(require(1212) /* getSystemLocale */.t.tGRbjA);
obj = { placeholder: null, value: null, onChange: null, showTopContainer: false, maxLength: 32, autoFocus: true };
const intl2 = require(1212) /* getSystemLocale */.intl;
obj.placeholder = intl2.string(require(1212) /* getSystemLocale */.t.xV9hVh);
2026-07-20 16:05:17 +00:00
obj.value = name;
obj.onChange = onNameChange;
2026-07-23 10:11:24 +00:00
obj.clearButtonVisibility = require(1273) /* Button */.ClearButtonVisibility.WITH_CONTENT;
2026-07-28 08:39:19 +00:00
obj.children = callback(require(7611) /* Form */.FormInput, obj);
const items = [callback(require(7611) /* Form */.FormSection, obj), ];
2026-07-20 16:05:17 +00:00
const obj1 = {};
2026-07-23 10:11:24 +00:00
const intl3 = require(1212) /* getSystemLocale */.intl;
obj1.title = intl3.string(require(1212) /* getSystemLocale */.t.xpurRF);
2026-07-28 08:39:19 +00:00
obj1.children = callback(importDefault(14922), { color, onChange: onColorChange });
items[1] = callback(require(7611) /* Form */.FormSection, obj1);
2026-07-20 16:05:17 +00:00
obj.children = items;
2026-07-28 08:39:19 +00:00
return callback2(require(7611) /* Form */.Form, obj);
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
({ jsx: closure_7, jsxs: closure_8 } = jsxProd);
let result = require("_isNativeReflectConstruct").fileFinishedImporting("modules/guilds_bar/native/GuildsBarFolderSettingsModal.tsx");
2026-07-20 16:05:17 +00:00
export default function GuildFolderSettingsModal(folderId) {
let initialFolderColor;
let initialFolderName;
folderId = folderId.folderId;
2026-07-23 10:11:24 +00:00
let c5;
let callback;
2026-07-20 16:05:17 +00:00
let callback1;
2026-07-23 10:11:24 +00:00
const items = [c5];
2026-07-20 16:05:17 +00:00
const items1 = [folderId];
2026-07-23 10:11:24 +00:00
const stateFromStoresObject = folderId(566).useStateFromStoresObject(items, () => {
const guildFolderById = _undefined.getGuildFolderById(folderId);
2026-07-20 16:05:17 +00:00
const obj = {};
let folderName;
if (null != guildFolderById) {
folderName = guildFolderById.folderName;
}
let str = "";
if (null != folderName) {
str = guildFolderById.folderName;
}
obj.initialFolderName = str;
let folderColor;
if (null != guildFolderById) {
folderColor = guildFolderById.folderColor;
}
obj.initialFolderColor = null != folderColor ? guildFolderById.folderColor : callback;
return obj;
}, items1);
({ initialFolderName, initialFolderColor } = stateFromStoresObject);
2026-07-23 10:11:24 +00:00
const tmp2 = first1(React.useState(initialFolderName), 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];
const tmp4 = first1(React.useState(initialFolderColor), 2);
first1 = tmp4[0];
React = tmp4[1];
c5 = tmp6;
2026-07-20 16:05:17 +00:00
const items2 = [folderId, first, first1];
callback = React.useCallback(() => {
2026-07-23 10:11:24 +00:00
(function updateFolder(folderId, first, first1) {
let closure_0 = folderId;
let closure_1 = first;
const table = first1;
guildFolders = guildFolders.getGuildFolders();
folderId(table[5]).saveGuildFolders(guildFolders.map((folderId) => {
2026-07-20 16:05:17 +00:00
let tmp = folderId;
2026-07-23 10:11:24 +00:00
if (folderId.folderId === closure_0) {
2026-07-20 16:05:17 +00:00
const obj = {};
const merged = Object.assign(folderId);
2026-07-23 10:11:24 +00:00
obj["folderName"] = closure_1;
obj["folderColor"] = closure_2;
2026-07-20 16:05:17 +00:00
tmp = obj;
}
return tmp;
}));
2026-07-23 10:11:24 +00:00
})(folderId, first, first1);
2026-07-28 08:39:19 +00:00
const result = folderId(14919).hideGuildsBarFolderModal();
2026-07-20 16:05:17 +00:00
}, items2);
callback1 = React.useCallback(() => {
2026-07-28 08:39:19 +00:00
const result = folderId(14919).hideGuildsBarFolderModal();
2026-07-20 16:05:17 +00:00
}, []);
const items3 = [first1, first, first !== initialFolderName || first1 !== initialFolderColor, callback, callback1];
2026-07-23 10:11:24 +00:00
const screens = React.useMemo(() => (function getScreens(arg0, c5, callback, callback1) {
let closure_0 = arg0;
2026-07-20 16:05:17 +00:00
let obj = {};
obj = {
render() {
2026-07-23 10:11:24 +00:00
const merged = Object.assign(closure_0);
return callback1(outer3_9, {});
2026-07-20 16:05:17 +00:00
}
};
2026-07-23 10:11:24 +00:00
const intl = folderId(1212).intl;
obj.title = intl.string(folderId(1212).t.Dx7im5);
2026-07-28 08:39:19 +00:00
obj.headerLeft = folderId(5121).getHeaderCloseButton(callback1);
2026-07-23 10:11:24 +00:00
if (c5) {
const intl2 = folderId(1212).intl;
2026-07-28 08:39:19 +00:00
let fn = folderId(5121).getHeaderTextButton(intl2.string(folderId(1212).t["R3BPH+"]), callback);
const obj4 = folderId(5121);
2026-07-20 16:05:17 +00:00
} else {
fn = () => null;
}
obj.headerRight = fn;
obj["Folder Settings"] = obj;
return obj;
2026-07-23 10:11:24 +00:00
})({
2026-07-20 16:05:17 +00:00
name: first,
onNameChange(arg0) {
2026-07-23 10:11:24 +00:00
return outer1_2(arg0);
2026-07-20 16:05:17 +00:00
},
color: first1,
onColorChange(arg0) {
2026-07-23 10:11:24 +00:00
return outer1_4(arg0);
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
}, c5, callback, callback1), items3);
2026-07-28 08:39:19 +00:00
return callback1(folderId(5552).Navigator, { screens, initialRouteName: "Folder Settings" });
2026-07-20 16:05:17 +00:00
};