decord/source/modules/create_guild/native/CreateGuild.tsx

157 lines
6 KiB
TypeScript
Raw Normal View History

2026-08-15 05:55:55 +00:00
// Module ID: 11503
// Function ID: 11504
2026-07-20 16:05:17 +00:00
// Name: CreateGuild
2026-08-15 05:55:55 +00:00
// Dependencies: [19, 17, 1922, 676, 21, 4661, 712, 4721, 4731, 4733, 4734, 1236, 10977, 8071, 7178, 4745, 8579, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-15 05:55:55 +00:00
// Module 11503 (CreateGuild)
2026-07-29 08:29:29 +00:00
import noop from "noop";
import { ScrollView } from "set";
import mergeGuildAvatar from "mergeGuildAvatar";
2026-07-23 10:11:24 +00:00
import { MarketingURLs } from "ME";
import jsxProd from "jsxProd";
2026-07-29 08:29:29 +00:00
import createCacheKey from "createCacheKey";
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
let error;
let metroImportAll;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
({ jsx: error, jsxs: metroImportAll } = jsxProd);
createCacheKey = { flex: { flex: 1 }, contentContainer: null, header: null, description: null, iconUploader: null, hint: null };
createCacheKey = { backgroundColor: require("Themes").colors.BACKGROUND_BASE_LOWER, paddingHorizontal: 16, paddingBottom: 16 };
createCacheKey[1] = createCacheKey;
createCacheKey[2] = { textAlign: "center" };
createCacheKey[3] = { lineHeight: 18, textAlign: "center", marginBottom: 24 };
createCacheKey[4] = { alignSelf: "center", marginBottom: 4 };
createCacheKey[5] = { marginBottom: 8 };
createCacheKey = createCacheKey.createStyles(createCacheKey);
let result = require("mergeGuildAvatar").fileFinishedImporting("modules/create_guild/native/CreateGuild.tsx");
2026-07-20 16:05:17 +00:00
export default function CreateGuild(arg0) {
let autoFocus;
let customButtonLabel;
let customDescription;
let customTitle;
let error;
let guild;
let onCreate;
let onIconPress;
let onNameChange;
let onStaffOnlyChange;
let submitting;
({ guild, error, customTitle, customDescription, customButtonLabel, autoFocus } = arg0);
({ onIconPress, onNameChange, onStaffOnlyChange, onCreate, submitting } = arg0);
if (autoFocus === undefined) {
autoFocus = true;
}
2026-07-23 10:11:24 +00:00
let isScreenReaderEnabled;
let ref;
2026-07-29 08:29:29 +00:00
let tmp = createCacheKey();
2026-07-23 10:11:24 +00:00
currentUser = currentUser.getCurrentUser();
2026-07-29 08:29:29 +00:00
let isStaffResult;
if (currentUser != null) {
isStaffResult = currentUser.isStaff();
}
2026-08-15 05:55:55 +00:00
let obj1 = isScreenReaderEnabled(4721);
2026-07-23 10:11:24 +00:00
isScreenReaderEnabled = obj1.useIsScreenReaderEnabled();
ref = React.useRef(null);
2026-07-20 16:05:17 +00:00
const items = [isScreenReaderEnabled];
const effect = React.useEffect(() => {
let tmp = isScreenReaderEnabled;
if (isScreenReaderEnabled) {
tmp = null != ref.current;
}
if (tmp) {
2026-07-23 10:11:24 +00:00
let obj = isScreenReaderEnabled(outer1_2[8]);
2026-07-29 08:29:29 +00:00
obj = { ref: null, delay: 100 };
obj[0] = ref;
2026-07-20 16:05:17 +00:00
const result = obj.setAccessibilityFocus(obj);
}
}, items);
2026-07-29 08:29:29 +00:00
let obj = { style: tmp.flex, contentInset: { top: 0 }, automaticallyAdjustContentInsets: false, keyboardShouldPersistTaps: "handled", alwaysBounceVertical: false, contentContainerStyle: tmp.contentContainer, children: null };
obj = { ref, style: tmp.header, accessibilityRole: "header", variant: "heading-xl/extrabold", color: "mobile-text-heading-primary", children: null };
if (customTitle == null) {
const intl = tmp4(1236).intl;
customTitle = intl.string(tmp4(1236).t.XioBx6);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[5] = customTitle;
2026-08-15 05:55:55 +00:00
const items1 = [closure_7(isScreenReaderEnabled(4734).Text, obj), , , , , , , ];
2026-07-29 08:29:29 +00:00
obj1 = { style: tmp.description, variant: "text-sm/medium", color: "text-default", children: null };
if (customDescription == null) {
const intl2 = tmp4(1236).intl;
customDescription = intl2.string(tmp4(1236).t["/k/L/j"]);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj1[3] = customDescription;
2026-08-15 05:55:55 +00:00
items1[1] = closure_7(isScreenReaderEnabled(4734).Text, obj1);
items1[2] = closure_7(ref(10977), { iconBackgroundColor: tmp.contentContainer.backgroundColor, style: tmp.iconUploader, onPress: onIconPress, icon: guild.icon });
2026-07-29 08:29:29 +00:00
const obj3 = { isClearable: true, label: null, errorMessage: null, value: null, onChange: null, autoFocus: null, autoCorrect: false, returnKeyType: "done" };
const intl3 = tmp4(1236).intl;
obj3[1] = intl3.string(isScreenReaderEnabled(1236).t.dBih7e);
2026-07-20 16:05:17 +00:00
let firstFieldErrorMessage;
2026-07-29 08:29:29 +00:00
if (error != null) {
2026-07-20 16:05:17 +00:00
firstFieldErrorMessage = error.getFirstFieldErrorMessage("name");
}
2026-07-29 08:29:29 +00:00
obj3[2] = firstFieldErrorMessage;
obj3[3] = guild.name;
obj3[4] = onNameChange;
2026-07-20 16:05:17 +00:00
if (autoFocus) {
autoFocus = !isScreenReaderEnabled;
}
2026-07-29 08:29:29 +00:00
let tmp9Result = !!isStaffResult;
obj3[5] = autoFocus;
2026-08-15 05:55:55 +00:00
items1[3] = closure_7(isScreenReaderEnabled(8071).TextInput, obj3);
2026-07-29 08:29:29 +00:00
if (tmp9Result) {
const obj4 = { onValueChange: null, value: null, start: true, end: true, label: "Staff Only", subLabel: null };
obj4[0] = onStaffOnlyChange;
obj4[1] = guild.staffOnly;
const intl4 = tmp4(1236).intl;
obj4[5] = intl4.string(tmp4(1236).t.edQ5va);
2026-08-15 05:55:55 +00:00
tmp9Result = tmp9(tmp4(7178).TableSwitchRow, obj4);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
items1[4] = tmp9Result;
const obj5 = { style: tmp.hint, variant: "text-xs/medium", color: "text-muted", children: null };
const intl5 = tmp4(1236).intl;
obj5[3] = intl5.format(isScreenReaderEnabled(1236).t["2bprXx"], { guidelinesURL: MarketingURLs.GUIDELINES });
2026-08-15 05:55:55 +00:00
items1[5] = closure_7(isScreenReaderEnabled(4734).Text, obj5);
2026-07-29 08:29:29 +00:00
const obj7 = { disabled: "" === guild.name, size: "md", grow: true, text: null, onPress: null, loading: null };
if (customButtonLabel == null) {
const intl6 = tmp4(1236).intl;
customButtonLabel = intl6.string(tmp4(1236).t["O0p/lS"]);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj7[3] = customButtonLabel;
obj7[4] = onCreate;
obj7[5] = submitting;
2026-08-15 05:55:55 +00:00
items1[6] = closure_7(isScreenReaderEnabled(4745).Button, obj7);
2026-07-20 16:05:17 +00:00
let firstFieldErrorMessage1;
2026-07-29 08:29:29 +00:00
if (error != null) {
2026-07-20 16:05:17 +00:00
firstFieldErrorMessage1 = error.getFirstFieldErrorMessage("name");
}
2026-07-29 08:29:29 +00:00
tmp9Result = null;
2026-07-20 16:05:17 +00:00
if (null == firstFieldErrorMessage1) {
let message;
2026-07-29 08:29:29 +00:00
if (error != null) {
2026-07-20 16:05:17 +00:00
message = error.message;
}
2026-07-29 08:29:29 +00:00
tmp9Result = null;
2026-07-20 16:05:17 +00:00
if (null != message) {
let message1;
2026-07-29 08:29:29 +00:00
if (error != null) {
2026-07-20 16:05:17 +00:00
message1 = error.message;
}
2026-07-29 08:29:29 +00:00
tmp9Result = null;
2026-07-20 16:05:17 +00:00
if ("" !== message1) {
let message2;
2026-07-29 08:29:29 +00:00
if (error != null) {
2026-07-20 16:05:17 +00:00
message2 = error.message;
}
2026-07-29 08:29:29 +00:00
const obj8 = { children: null };
obj8[0] = message2;
2026-08-15 05:55:55 +00:00
tmp9Result = tmp9(ref(8579), obj8);
const tmp12Result = ref(8579);
2026-07-20 16:05:17 +00:00
}
}
}
2026-07-29 08:29:29 +00:00
items1[7] = tmp9Result;
2026-08-15 05:55:55 +00:00
obj[6] = closure_8(isScreenReaderEnabled(4733).Stack, { children: items1 });
2026-07-29 08:29:29 +00:00
return closure_7(ScrollView, obj);
2026-07-20 16:05:17 +00:00
};