Files
discord-decomp/sources/modules/user_profile/native/UserProfileLegacyUsernameSwitch.tsx
2026-07-28 01:06:53 +03:00

51 lines
3.4 KiB
TypeScript

/* Metro module 13229; source: modules/user_profile/native/UserProfileLegacyUsernameSwitch.tsx; dependencies: [31, 33, 3829, 13209, 1244, 7620, 8400, 2] */
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 UserSettingsModule from '../../user_settings/UserSettings.tsx'; /* Metro dependency 3829 */
import * as UserProfileEditFormControlsModule from './UserProfileEditFormControls.tsx'; /* Metro dependency 13209 */
function _fun100906(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#100906, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13419:6, offset: 0x021ff8be, size: 131 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
ReactModule;
(FileImportTrackerModule).fileFinishedImporting('modules/user_profile/native/UserProfileLegacyUsernameSwitch.tsx');
exports.default = UserProfileLegacyUsernameSwitch;
function UserProfileLegacyUsernameSwitch({legacyUsername, pendingLegacyUsernameDisabled}) { // fn#100907, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13419:225, offset: 0x021ff941, size: 243 bytes, params: 2, frame: 21
const LegacyUsernameDisabled = (UserSettingsModule).LegacyUsernameDisabled;
const r5 = pendingLegacyUsernameDisabled === undefined ? LegacyUsernameDisabled.useSetting() : pendingLegacyUsernameDisabled;
const UserProfileEditFormSwitch = (UserProfileEditFormControlsModule).UserProfileEditFormSwitch;
const intl = (IndexNativeModule).intl;
return (
<UserProfileEditFormSwitch
value={!r5}
label={intl.string((IndexNativeModule).t['3cWDuO'])}
subLabel={intl.formatToPlainString((IndexNativeModule).t.aYhclf,
{username: legacyUsername})}
onValueChange={onValueChange_100908}
/>
);
function UserProfileLegacyUsernameSwitchOnValueChange(a0) { // fn#100908, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13419:572, owner: UserProfileLegacyUsernameSwitch.onValueChange, offset: 0x021ffa34, size: 104 bytes, params: 2, frame: 12
var value3;
var moduleValue;
let value = !a0;
if (value === env0_0) {
value = environment.__proto__;
value = require(7620) /* metro dependency 7620: UserSettingsAccountActionCreators */;
value.resetPendingLegacyUsernameDisabled();
} else {
value3 = environment.__proto__;
moduleValue = require(8400) /* metro dependency 8400: UserProfileSettingsActionCreators */;
moduleValue.setPendingChanges({legacyUsernameDisabled: value});
}
}
}
}
global.__d(_fun100906, 13229, [31, 33, 3829, 13209, 1244, 7620, 8400,
2]) /* metro module 13229, dependencies: [31, 33, 3829, 13209, 1244, 7620, 8400, 2] */;