decord/source/modules/user_profile/native/UserProfileLegacyUsernameSwitch.tsx

49 lines
2.1 KiB
TypeScript
Raw Normal View History

// Module ID: 14859
// Function ID: 14860
2026-07-20 16:05:17 +00:00
// Name: UserProfileLegacyUsernameSwitch
// Dependencies: [19, 21, 1936, 14834, 1115, 7180, 8394, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
// Module 14859 (UserProfileLegacyUsernameSwitch)
import UserSettingsAccountActionCreators from "UserSettingsAccountActionCreators" /* 7180 */;
import UserProfileSettingsActionCreators from "UserProfileSettingsActionCreators" /* 8394 */;
import noop from "module_19" /* 19 */;
2026-07-23 10:11:24 +00:00
require = fn;
const jsx = fn(21).jsx;
const size = fn(2);
let result = size.fileFinishedImporting("modules/user_profile/native/UserProfileLegacyUsernameSwitch.tsx");
2026-07-20 16:05:17 +00:00
2026-09-01 10:26:29 +00:00
export default function UserProfileLegacyUsernameSwitch(pendingLegacyUsernameDisabled) {
pendingLegacyUsernameDisabled = pendingLegacyUsernameDisabled.pendingLegacyUsernameDisabled;
2026-07-29 08:29:29 +00:00
let setting;
const LegacyUsernameDisabled = setting(1936).LegacyUsernameDisabled;
2026-07-23 10:11:24 +00:00
setting = LegacyUsernameDisabled.useSetting();
2026-07-29 08:29:29 +00:00
let tmp4 = setting;
2026-07-20 16:05:17 +00:00
if (undefined !== pendingLegacyUsernameDisabled) {
2026-07-29 08:29:29 +00:00
tmp4 = pendingLegacyUsernameDisabled;
2026-07-20 16:05:17 +00:00
}
2026-09-01 10:26:29 +00:00
let obj = { value: !tmp4, label: null, subLabel: null, accessibilityLabel: null, onValueChange: null };
const intl = tmp(1115).intl;
obj.label = intl.string(setting(1115).t["3cWDuO"]);
const intl2 = tmp(1115).intl;
2026-09-01 10:26:29 +00:00
if (tmp4) {
let stringResult = intl2.string(tmp(1115).t.eD6Yq0);
2026-09-01 10:26:29 +00:00
} else {
let obj2 = { username: pendingLegacyUsernameDisabled.legacyUsername };
stringResult = intl2.formatToPlainString(tmp(1115).t.aYhclf, obj2);
2026-09-01 10:26:29 +00:00
}
obj.subLabel = stringResult;
const intl3 = tmp(1115).intl;
obj.accessibilityLabel = intl3.string(setting(1115).t["3cWDuO"]);
obj.onValueChange = function onValueChange(arg0) {
2026-07-20 16:05:17 +00:00
if (!arg0 === setting) {
const result = UserSettingsAccountActionCreators.resetPendingLegacyUsernameDisabled();
2026-07-20 16:05:17 +00:00
} else {
const obj2 = { legacyUsernameDisabled: !arg0 };
UserProfileSettingsActionCreators.setPendingChanges(obj2);
2026-07-20 16:05:17 +00:00
}
};
return jsx(setting(14834).UserProfileEditFormSwitch, { value: !tmp4, label: null, subLabel: null, accessibilityLabel: null, onValueChange: null });
2026-07-20 16:05:17 +00:00
};