158 lines
8.6 KiB
TypeScript
158 lines
8.6 KiB
TypeScript
/* Metro module 9663; source: modules/create_guild/native/CreateGuild.tsx; dependencies: [31, 27, 1878, 661, 33, 4501, 697, 4559, 4570, 4572, 4573, 1244, 9664, 7981, 6808, 6766, 4578, 8970, 2] */
|
|
import Native from '../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
|
|
import UserStore from '../../../stores/UserStore.tsx'; /* Metro dependency 1878 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactNativeModule from '../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
|
|
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 ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as UseIsScreenReaderEnabledNativeModule from '../../a11y/native/useIsScreenReaderEnabled.native.tsx'; /* Metro dependency 4559 */
|
|
import * as StackNativeModule from '../../../design/components/Stack/native/Stack.native.tsx'; /* Metro dependency 4572 */
|
|
import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
|
|
import * as ButtonNativeModule from '../../../design/components/Button/native/Button.native.tsx'; /* Metro dependency 4578 */
|
|
import * as TextWithIOSLinkWorkaroundModule from '../../a11y/native/TextWithIOSLinkWorkaround.tsx'; /* Metro dependency 6766 */
|
|
import * as TextInputNativeModule from '../../../design/components/TextInput/native/TextInput.native.tsx'; /* Metro dependency 7981 */
|
|
|
|
function _fun75755(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#75755, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9849:6, offset: 0x01db7e52, size: 362 bytes, params: 8, frame: 21
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = JsxRuntimeModule;
|
|
const env0_7 = value.jsx;
|
|
const env0_8 = value.jsxs;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
const BACKGROUND_BASE_LOWER = (Native).colors.BACKGROUND_BASE_LOWER;
|
|
const env0_9 = Reflect.apply(createStyles, value, [{flex: {flex: 1}, contentContainer: {'backgroundColor': null,
|
|
'paddingHorizontal': 16, 'paddingBottom': 16, backgroundColor: BACKGROUND_BASE_LOWER},
|
|
header: {textAlign: 'center'}, description: {'lineHeight': 18, 'textAlign': 'center', 'marginBottom': 24},
|
|
iconUploader: {'alignSelf': 'center', 'marginBottom': 4}, hint: {marginBottom: 8}}]);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/create_guild/native/CreateGuild.tsx');
|
|
exports.default = CreateGuild;
|
|
function CreateGuild({guild, onIconPress, onNameChange, onStaffOnlyChange, onCreate, submitting, error, customTitle, customDescription, customButtonLabel, autoFocus}) { // fn#75756, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9849:588, offset: 0x01db7fbc, size: 1331 bytes, params: 2, frame: 42
|
|
var r8;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
var TableSwitchRow;
|
|
autoFocus = autoFocus === undefined || autoFocus;
|
|
const styles = useStyles();
|
|
const currentUser = UserStore.getCurrentUser();
|
|
const r10 = currentUser == null || !currentUser.isStaff();
|
|
const value8 = !r10;
|
|
const value9 = (UseIsScreenReaderEnabledNativeModule).useIsScreenReaderEnabled();
|
|
const value10 = ReactModule.useRef(null);
|
|
ReactModule.useEffect(_fun75757, [value9]);
|
|
const scrollViewBindingProps = {'style': null, 'contentInset': null, 'automaticallyAdjustContentInsets': false,
|
|
'keyboardShouldPersistTaps': 'handled', 'alwaysBounceVertical': false, style: styles.flex,
|
|
contentInset: {top: 0}, contentContainerStyle: styles.contentContainer};
|
|
const Stack = (StackNativeModule).Stack;
|
|
const Text = (TextModule).Text;
|
|
const items2 = [
|
|
<Text
|
|
ref={value10}
|
|
style={styles.header}
|
|
accessibilityRole="header"
|
|
variant="heading-xl/extrabold"
|
|
color="mobile-text-heading-primary"
|
|
>
|
|
{customTitle ?? intl.string((require(1244) /* metro dependency 1244: indexNative */).t.XioBx6)}
|
|
</Text>,
|
|
];
|
|
items2[1] = (
|
|
<Text
|
|
style={styles.description}
|
|
variant="text-sm/medium"
|
|
color="text-default"
|
|
>
|
|
{customDescription ?? intl.string((require(1244) /* metro dependency 1244: indexNative */).t['/k/L/j'])}
|
|
</Text>
|
|
);
|
|
items2[2] = ((Component) => <Component iconBackgroundColor={styles.contentContainer.backgroundColor} style={styles.iconUploader} onPress={onIconPress} icon={guild.icon} />)(importDefault(9664) /* metro dependency 9664: GuildIconUploader */);
|
|
const TextInput = (TextInputNativeModule).TextInput;
|
|
items2[3] = (
|
|
<TextInput
|
|
isClearable
|
|
label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.dBih7e)}
|
|
errorMessage={error?.getFirstFieldErrorMessage('name')}
|
|
value={guild.name}
|
|
onChange={onNameChange}
|
|
autoFocus={autoFocus && !value9}
|
|
autoCorrect={false}
|
|
returnKeyType="done"
|
|
/>
|
|
);
|
|
if (r10) {
|
|
r8 = value8;
|
|
} else {
|
|
TableSwitchRow = (require(6808) /* metro dependency 6808: TableSwitchRowNative */).TableSwitchRow;
|
|
r8 = (
|
|
<TableSwitchRow
|
|
onValueChange={onStaffOnlyChange}
|
|
value={guild.staffOnly}
|
|
start
|
|
end
|
|
label="Staff Only"
|
|
subLabel={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.edQ5va)}
|
|
/>
|
|
);
|
|
}
|
|
items2[4] = r8;
|
|
const TextWithIOSLinkWorkaround = (TextWithIOSLinkWorkaroundModule).TextWithIOSLinkWorkaround;
|
|
const format = intl.format;
|
|
const property = (require(1244) /* metro dependency 1244: indexNative */).t['2bprXx'];
|
|
const GUIDELINES = MarketingURLs.GUIDELINES;
|
|
items2[5] = (
|
|
<TextWithIOSLinkWorkaround
|
|
style={styles.hint}
|
|
variant="text-xs/medium"
|
|
color="text-muted"
|
|
>
|
|
{Reflect.apply(format, intl, [property, {guidelinesURL: GUIDELINES}])}
|
|
</TextWithIOSLinkWorkaround>
|
|
);
|
|
const Button = (ButtonNativeModule).Button;
|
|
items2[6] = (
|
|
<Button
|
|
disabled={guild.name === ''}
|
|
size="md"
|
|
grow
|
|
text={customButtonLabel ?? intl.string((require(1244) /* metro dependency 1244: indexNative */).t['O0p/lS'])}
|
|
onPress={onCreate}
|
|
loading={submitting}
|
|
/>
|
|
);
|
|
r8 = error?.getFirstFieldErrorMessage('name');
|
|
r8 = (
|
|
r8 == null && error?.message != null
|
|
? (
|
|
error?.message === ''
|
|
? null
|
|
: ((Component) => <Component>{error?.message}</Component>)(importDefault(8970) /* metro dependency 8970: FreeFormErrorLabel */)
|
|
)
|
|
: null
|
|
);
|
|
items2[7] = r8;
|
|
return (
|
|
<ScrollView {...scrollViewBindingProps}>
|
|
<Stack>
|
|
{items2}
|
|
</Stack>
|
|
</ScrollView>
|
|
);
|
|
function _fun75757() { // fn#75757, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9849:904, offset: 0x01db84ef, size: 86 bytes, params: 1, frame: 12
|
|
var value3;
|
|
var moduleValue;
|
|
if (env0_0 && env0_1.current != null) {
|
|
value3 = environment.__proto__;
|
|
moduleValue = require(4570) /* metro dependency 4570: setAccessibilityFocusAndroid */;
|
|
moduleValue.setAccessibilityFocus({ref: env0_1, delay: 100});
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun75755, 9663, [31, 27, 1878, 661, 33, 4501, 697, 4559, 4570, 4572, 4573, 1244, 9664, 7981, 6808, 6766,
|
|
4578, 8970,
|
|
2]) /* metro module 9663, dependencies: [31, 27, 1878, 661, 33, 4501, 697, 4559, 4570, 4572, 4573, 1244, 9664, 7981, 6808, 6766, 4578, 8970, 2] */;
|