Files
2026-07-28 01:06:53 +03:00

170 lines
11 KiB
TypeScript

/* Metro module 14389; source: modules/guilds_bar/native/GuildsBarFolderSettingsModal.tsx; dependencies: [57, 31, 4896, 14390, 33, 7896, 7972, 1244, 1305, 14391, 5282, 566, 14388, 5280, 2] */
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
import SortedGuildStore from '../../../stores/SortedGuildStore.tsx'; /* Metro dependency 4896 */
import FormRoleColorPicker from '../../../components_native/common/color_picker/FormRoleColorPicker.tsx'; /* Metro dependency 14391 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as JsxRuntimeModule from '../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as NativeModule from '../../../design/void/native.tsx'; /* Metro dependency 1305 */
import * as NavigatorNativeModule from '../../../design/components/Navigator/native/Navigator.native.tsx'; /* Metro dependency 5280 */
import * as UserSettingsActionCreatorsModule from '../../../actions/UserSettingsActionCreators.tsx'; /* Metro dependency 7896 */
import * as NativeModule2 from '../../../design/void/Form/native/index.tsx'; /* Metro dependency 7972 */
import * as GuildsBarFolderSettingsModalActionCreatorsModule from './GuildsBarFolderSettingsModalActionCreators.tsx'; /* Metro dependency 14388 */
import * as GuildsBarConstantsModule from '../GuildsBarConstants.tsx'; /* Metro dependency 14390 */
function _fun108920(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#108920, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14586:6, offset: 0x023349d6, size: 216 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(FileImportTrackerModule).fileFinishedImporting('modules/guilds_bar/native/GuildsBarFolderSettingsModal.tsx');
exports.default = GuildFolderSettingsModal;
function GuildFolderSettingsScene({name, onNameChange, color, onColorChange}) { // fn#108921, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14586:184, offset: 0x02334aae, size: 420 bytes, params: 2, frame: 31
const Form = (NativeModule2).Form;
const FormSection = (NativeModule2).FormSection;
const object2 = {};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
object2.title = Reflect.apply(string, intl, [(require(1244) /* metro dependency 1244: indexNative */).t.tGRbjA]);
const FormInput = (NativeModule2).FormInput;
string = intl.string;
const xV9hVh = (require(1244) /* metro dependency 1244: indexNative */).t.xV9hVh;
const ClearButtonVisibility = (NativeModule).ClearButtonVisibility;
const WITH_CONTENT = ClearButtonVisibility.WITH_CONTENT;
return (
<Form>
<FormSection {...object2}>
<FormInput
placeholder={Reflect.apply(string, intl, [xV9hVh])}
value={name}
onChange={onNameChange}
showTopContainer={false}
maxLength={32}
autoFocus
clearButtonVisibility={WITH_CONTENT}
/>
</FormSection>
<FormSection title={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.xpurRF)}>
{((Component) => <Component color={color} onChange={onColorChange} />)(FormRoleColorPicker)}
</FormSection>
</Form>
);
}
function GuildFolderSettingsModal({folderId}) { // fn#108922, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14586:821, offset: 0x02334c52, size: 365 bytes, params: 2, frame: 23
const {initialFolderName,
initialFolderColor} = (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([SortedGuildStore],
function() {
var r5;
var value3 = SortedGuildStore.getGuildFolderById(folderId);
var value4 = undefined;
r5 = value3 == null ? value4 : value3.folderName;
r5 = r5 != null ? value3.folderName : '';
return {initialFolderName: r5,
initialFolderColor: (value3 == null ? value4 : value3.folderColor) != null ? value3.folderColor : DEFAULT_FOLDER_COLOR};
}, [folderId]);
let binding = env0_4;
let useState = binding.useState;
let value3 = Reflect.apply(useState, binding, [initialFolderName]);
let value4 = Module00057(value3, 2);
const property = value4[0];
const env0_2 = value4[1];
useState = binding.useState;
const value5 = Module00057(Reflect.apply(useState, binding, [initialFolderColor]), 2);
const property2 = value5[0];
var env0_4 = value5[1];
const r8 = property !== initialFolderName || property2 !== initialFolderColor;
binding = env0_4;
const value10 = binding.useMemo(_fun108928, [property2, property, r8, binding.useCallback(_fun108924, [folderId,
property, property2]), binding.useCallback(_fun108927, [])]);
const Navigator = (NavigatorNativeModule).Navigator;
return <Navigator screens={value10} initialRouteName="Folder Settings" />;
function _fun108924() { // fn#108924, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14586:1261, offset: 0x02334e27, size: 68 bytes, params: 1, frame: 15
var environment;
updateFolder(folderId, env0_1, Module00057);
const value = environment.__proto__;
(GuildsBarFolderSettingsModalActionCreatorsModule).hideGuildsBarFolderModal();
function updateFolder(a0, a1, a2) { // fn#108925, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14586:1267, offset: 0x02334e6b, size: 92 bytes, params: 4, frame: 14
var environment;
const env0_0 = a0;
const env0_1 = a1;
const env0_2 = a2;
let value = environment.__proto__.__proto__;
const saveGuildFolders = UserSettingsActionCreatorsModule.saveGuildFolders;
value = SortedGuildStore.getGuildFolders();
Reflect.apply(saveGuildFolders, UserSettingsActionCreatorsModule, [value.map(_fun108926)]);
function _fun108926(a0) { // fn#108926, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14586:1346, offset: 0x02334ec7, size: 66 bytes, params: 2, frame: 14
var r0;
var object;
const value = a0;
const folderId = value.folderId;
if (folderId !== env0_0) {
r0 = value;
} else {
object = {};
copyDataProperties(object, value, folderId);
object['folderName'] = require;
object['folderColor'] = importDefault;
r0 = object;
}
return r0;
}
}
}
function _fun108927() { // fn#108927, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14586:1475, offset: 0x02334f09, size: 37 bytes, params: 1, frame: 11
const value = environment.__proto__;
(GuildsBarFolderSettingsModalActionCreatorsModule).hideGuildsBarFolderModal();
}
function _fun108928() { // fn#108928, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14586:1535, offset: 0x02334f2e, size: 77 bytes, params: 1, frame: 17
return getScreens_108929({name: env0_1, onNameChange: onNameChange, color: Module00057, onColorChange: onColorChange},
env0_5, GuildsBarConstantsModule.DEFAULT_FOLDER_COLOR, JsxRuntimeModule.jsx);
function getScreens_108929(a0, a1, a2, a3) { // fn#108929, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14586:1539, offset: 0x02334f7b, size: 229 bytes, params: 5, frame: 20
var environment;
var r1;
const env0_0 = a0;
const object2 = {render: render_108930};
let value = environment.__proto__.__proto__;
const intl = (IndexNativeModule).intl;
const string = intl.string;
const t = (IndexNativeModule).t;
const Dx7im5 = t.Dx7im5;
object2.title = Reflect.apply(string, intl, [Dx7im5]);
object2.headerLeft = (require(5282) /* metro dependency 5282: NavigatorHeaderNative */).getHeaderCloseButton(a3);
if (a1) {
value = require(5282) /* metro dependency 5282: NavigatorHeaderNative */;
value = value.getHeaderTextButton(intl.string(t['R3BPH+']), a2);
r1 = value;
} else {
r1 = function() {
return null;
};
}
object2.headerRight = r1;
return {['Folder Settings']: object2};
function getScreens_108929Render() { // fn#108930, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14586:1587, owner: getScreens_108929.render, offset: 0x02335060, size: 37 bytes, params: 1, frame: 13
return <GuildFolderSettingsScene {...env0_0} />;
}
}
function onNameChange(a0) { // fn#108932, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14586:1834, offset: 0x02335085, size: 19 bytes, params: 2, frame: 11
return env1_2(a0);
}
function onColorChange(a0) { // fn#108933, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14586:1864, offset: 0x01e1b407, size: 19 bytes, params: 2, frame: 11
return env1_4(a0);
}
}
}
}
global.__d(_fun108920, 14389, [57, 31, 4896, 14390, 33, 7896, 7972, 1244, 1305, 14391, 5282, 566, 14388, 5280,
2]) /* metro module 14389, dependencies: [57, 31, 4896, 14390, 33, 7896, 7972, 1244, 1305, 14391, 5282, 566, 14388, 5280, 2] */;