Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4821.js (118.4 MB)
134 lines
5.7 KiB
TypeScript
134 lines
5.7 KiB
TypeScript
// Module ID: 12463
|
|
// Function ID: 12464
|
|
// Name: CreateGuild
|
|
// Dependencies: [19, 17, 1371, 1074, 21, 4636, 576, 5043, 5052, 5054, 4632, 1114, 11928, 6707, 7303, 5056, 7042, 2]
|
|
// Exports: default
|
|
|
|
// Module 12463 (CreateGuild)
|
|
import nativeDefault from "native" /* 576 */;
|
|
import setAccessibilityFocus from "setAccessibilityFocus" /* 5052 */;
|
|
import noop from "module_19" /* 19 */;
|
|
import UserStore from "UserStore" /* 1371 */;
|
|
|
|
require = fn;
|
|
const ScrollView = fn(17).ScrollView;
|
|
const MarketingURLs = fn(1074).MarketingURLs;
|
|
const jsxProd = fn(21);
|
|
({ jsx: closure_7, jsxs: closure_8 } = jsxProd);
|
|
const createStyles = fn(4636);
|
|
let obj2 = { flex: { flex: 1 }, contentContainer: { backgroundColor: nativeDefault.colors.BACKGROUND_BASE_LOWER, paddingHorizontal: 16, paddingBottom: 16 }, header: { textAlign: "center" }, description: { lineHeight: 18, textAlign: "center", marginBottom: 24 }, iconUploader: { alignSelf: "center", marginBottom: 4 }, hint: { marginBottom: 8 } };
|
|
let closure_9 = createStyles.createStyles(obj2);
|
|
const size = fn(2);
|
|
let result = size.fileFinishedImporting("modules/create_guild/native/CreateGuild.tsx");
|
|
|
|
export default function CreateGuild(arg0) {
|
|
({ guild, error, customTitle, customDescription, customButtonLabel, autoFocus } = arg0);
|
|
({ onIconPress, onNameChange, onStaffOnlyChange, onCreate, submitting } = arg0);
|
|
if (autoFocus === undefined) {
|
|
autoFocus = true;
|
|
}
|
|
let isScreenReaderEnabled;
|
|
let ref;
|
|
let tmp = closure_9();
|
|
const currentUser = UserStore.getCurrentUser();
|
|
let isStaffResult;
|
|
if (currentUser != null) {
|
|
isStaffResult = currentUser.isStaff();
|
|
}
|
|
isScreenReaderEnabled = isScreenReaderEnabled(5043).useIsScreenReaderEnabled();
|
|
ref = noop.useRef(null);
|
|
const items = [isScreenReaderEnabled];
|
|
const effect = noop.useEffect(() => {
|
|
let tmp = isScreenReaderEnabled;
|
|
if (isScreenReaderEnabled) {
|
|
tmp = null != ref.current;
|
|
}
|
|
if (tmp) {
|
|
const obj2 = { ref, delay: 100 };
|
|
const result = setAccessibilityFocus.setAccessibilityFocus(obj2);
|
|
}
|
|
}, items);
|
|
let obj = { style: tmp.flex, contentInset: { top: 0 }, automaticallyAdjustContentInsets: false, keyboardShouldPersistTaps: "handled", alwaysBounceVertical: false, contentContainerStyle: tmp.contentContainer, children: null };
|
|
const obj3 = { ref, style: tmp.header, accessibilityRole: "header", variant: "heading-xl/extrabold", color: "mobile-text-heading-primary", children: null };
|
|
if (customTitle == null) {
|
|
const intl = tmp4(1114).intl;
|
|
customTitle = intl.string(tmp4(1114).t.XioBx6);
|
|
}
|
|
obj3.children = customTitle;
|
|
const items1 = [closure_7(isScreenReaderEnabled(4632).Text, obj3), , , , , , , ];
|
|
const obj4 = { style: tmp.description, variant: "text-sm/medium", color: "text-default", children: null };
|
|
if (customDescription == null) {
|
|
const intl2 = tmp4(1114).intl;
|
|
customDescription = intl2.string(tmp4(1114).t["/k/L/j"]);
|
|
}
|
|
obj4.children = customDescription;
|
|
items1[1] = closure_7(isScreenReaderEnabled(4632).Text, obj4);
|
|
items1[2] = closure_7(ref(11928), { iconBackgroundColor: tmp.contentContainer.backgroundColor, style: tmp.iconUploader, onPress: onIconPress, icon: guild.icon });
|
|
const obj6 = { isClearable: true, label: null, errorMessage: null, value: null, onChange: null, autoFocus: null, autoCorrect: false, returnKeyType: "done" };
|
|
const intl3 = tmp4(1114).intl;
|
|
obj6.label = intl3.string(isScreenReaderEnabled(1114).t.dBih7e);
|
|
let firstFieldErrorMessage;
|
|
if (error != null) {
|
|
firstFieldErrorMessage = error.getFirstFieldErrorMessage("name");
|
|
}
|
|
obj6.errorMessage = firstFieldErrorMessage;
|
|
obj6.value = guild.name;
|
|
obj6.onChange = onNameChange;
|
|
if (autoFocus) {
|
|
autoFocus = !isScreenReaderEnabled;
|
|
}
|
|
let tmp9Result = !!isStaffResult;
|
|
obj6.autoFocus = autoFocus;
|
|
items1[3] = closure_7(isScreenReaderEnabled(6707).TextInput, obj6);
|
|
if (tmp9Result) {
|
|
const obj7 = { onValueChange: onStaffOnlyChange, value: guild.staffOnly, start: true, end: true, label: "Staff Only", subLabel: null };
|
|
const intl4 = tmp4(1114).intl;
|
|
obj7.subLabel = intl4.string(tmp4(1114).t.edQ5va);
|
|
tmp9Result = tmp9(tmp4(7303).TableSwitchRow, obj7);
|
|
}
|
|
items1[4] = tmp9Result;
|
|
const obj8 = { style: tmp.hint, variant: "text-xs/medium", color: "text-muted", children: null };
|
|
const intl5 = tmp4(1114).intl;
|
|
obj8.children = intl5.format(isScreenReaderEnabled(1114).t["2bprXx"], { guidelinesURL: MarketingURLs.GUIDELINES });
|
|
items1[5] = closure_7(isScreenReaderEnabled(4632).Text, obj8);
|
|
const obj10 = { disabled: "" === guild.name, size: "md", grow: true, text: null, onPress: null, loading: null };
|
|
if (customButtonLabel == null) {
|
|
const intl6 = tmp4(1114).intl;
|
|
customButtonLabel = intl6.string(tmp4(1114).t["O0p/lS"]);
|
|
}
|
|
obj10.text = customButtonLabel;
|
|
obj10.onPress = onCreate;
|
|
obj10.loading = submitting;
|
|
items1[6] = closure_7(isScreenReaderEnabled(5056).Button, obj10);
|
|
let firstFieldErrorMessage1;
|
|
if (error != null) {
|
|
firstFieldErrorMessage1 = error.getFirstFieldErrorMessage("name");
|
|
}
|
|
let tmp9Result2 = null;
|
|
if (null == firstFieldErrorMessage1) {
|
|
let message;
|
|
if (error != null) {
|
|
message = error.message;
|
|
}
|
|
tmp9Result2 = null;
|
|
if (null != message) {
|
|
let message1;
|
|
if (error != null) {
|
|
message1 = error.message;
|
|
}
|
|
tmp9Result2 = null;
|
|
if ("" !== message1) {
|
|
let message2;
|
|
if (error != null) {
|
|
message2 = error.message;
|
|
}
|
|
const obj11 = { children: message2 };
|
|
tmp9Result2 = tmp9(ref(7042), obj11);
|
|
const tmp12Result = ref(7042);
|
|
}
|
|
}
|
|
}
|
|
items1[7] = tmp9Result2;
|
|
obj.children = closure_8(isScreenReaderEnabled(5054).Stack, { children: items1 });
|
|
return closure_7(ScrollView, obj);
|
|
};
|