121 lines
6.7 KiB
TypeScript
121 lines
6.7 KiB
TypeScript
/* Metro module 9399; source: modules/oauth2/native/GuildSelector.tsx; dependencies: [31, 27, 661, 33, 4501, 697, 4080, 9059, 1962, 1244, 483, 4573, 1305, 7972, 2] */
|
|
import ActionSheetActionCreators from '../../action_sheet/native/ActionSheetActionCreators.tsx'; /* Metro dependency 4080 */
|
|
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 NativeModule from '../../../design/void/native.tsx'; /* Metro dependency 1305 */
|
|
import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
|
|
import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
|
|
import * as NativeModule2 from '../../../design/void/Form/native/index.tsx'; /* Metro dependency 7972 */
|
|
|
|
function _fun73278(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#73278, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9585:6, offset: 0x01d665fd, size: 380 bytes, params: 8, frame: 22
|
|
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;
|
|
const createStyles = (CreateStylesModule).createStyles;
|
|
object = {selectorGroup: {'display': 'flex', 'flexDirection': 'column', 'gap': 8}};
|
|
const object2 = {};
|
|
const BACKGROUND_BASE_LOWER = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWER;
|
|
object2.backgroundColor = BACKGROUND_BASE_LOWER;
|
|
object2.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xs;
|
|
object.select = object2;
|
|
const TEXT_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_SUBTLE;
|
|
object.label = {color: TEXT_SUBTLE, fontWeight: '500'};
|
|
const RED_400 = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.RED_400;
|
|
object.error = {color: RED_400};
|
|
value = Reflect.apply(createStyles, value, [object]);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/oauth2/native/GuildSelector.tsx');
|
|
exports.default = GuildSelector;
|
|
exports.useStyles = value;
|
|
function GuildSelector({error, selectedGuildId, onGuildChange, guilds, disabled}) { // fn#73279, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9585:556, offset: 0x01d66779, size: 605 bytes, params: 2, frame: 28
|
|
const LegacyText = (NativeModule).LegacyText;
|
|
const styles = useStyles();
|
|
const value3 = ReactModule.useCallback(_fun73280, [guilds, onGuildChange, selectedGuildId]);
|
|
const value4 = guilds.find(function({id}) {
|
|
return id === selectedGuildId;
|
|
});
|
|
const Text = (TextModule).Text;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const items2 = [
|
|
<Text variant="eyebrow" color="text-default">
|
|
{intl.string((require(1244) /* metro dependency 1244: indexNative */).t['1DXFFd'])}
|
|
</Text>,
|
|
];
|
|
items2[1] = (
|
|
error != null
|
|
? (
|
|
error === ''
|
|
? null
|
|
: (
|
|
<LegacyText style={styles.error}>
|
|
{error}
|
|
</LegacyText>
|
|
)
|
|
)
|
|
: null
|
|
);
|
|
const FormRow = (NativeModule2).FormRow;
|
|
const r9 = value4?.name ?? intl.string((require(1244) /* metro dependency 1244: indexNative */).t.oM4E1A);
|
|
const FormRow2 = (NativeModule2).FormRow;
|
|
const Arrow = FormRow2.Arrow;
|
|
items2[2] = (
|
|
<FormRow
|
|
label={r9}
|
|
disabled={disabled}
|
|
trailing={<Arrow />}
|
|
DEPRECATED_style={styles.select}
|
|
onPress={value3}
|
|
/>
|
|
);
|
|
items2[3] = (
|
|
<LegacyText style={styles.label}>
|
|
{intl.format((require(1244) /* metro dependency 1244: indexNative */).t.t9Jm9o, {})}
|
|
</LegacyText>
|
|
);
|
|
return (
|
|
<View style={styles.selectorGroup}>
|
|
{items2}
|
|
</View>
|
|
);
|
|
function _fun73280() { // fn#73280, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9585:673, offset: 0x01d669d6, size: 224 bytes, params: 1, frame: 21
|
|
var environment;
|
|
let value = environment.__proto__;
|
|
const value2 = undefined;
|
|
const defaultImport = importDefault(dependencyMap[6]);
|
|
const openLazy = defaultImport.openLazy;
|
|
value = require(dependencyMap[8]);
|
|
value = value(dependencyMap[7], dependencyMap.paths);
|
|
const object = {};
|
|
const intl = require(dependencyMap[9]).intl;
|
|
object.title = intl.string(require(dependencyMap[9]).t.oM4E1A);
|
|
object.items = guilds.filter(function(a0) {
|
|
return importAll(dependencyMap[10]).has(a0.permissions, Permissions.MANAGE_GUILD);
|
|
}).map(function(a0) {
|
|
return {label: a0.name, value: a0.id};
|
|
});
|
|
object.onItemSelect = onItemSelect_73283;
|
|
object.selectedItem = selectedGuildId ?? value2;
|
|
object.hasIcons = false;
|
|
Reflect.apply(openLazy, defaultImport, [value, 'GuildSelector', object]);
|
|
return value2;
|
|
function onItemSelect_73283(a0) { // fn#73283, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9585:866, offset: 0x01d66b08, size: 59 bytes, params: 2, frame: 12
|
|
let value = environment.__proto__;
|
|
onGuildChange(a0);
|
|
value = environment.__proto__.__proto__;
|
|
(ActionSheetActionCreators).hideActionSheet('GuildSelector');
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun73278, 9399, [31, 27, 661, 33, 4501, 697, 4080, 9059, 1962, 1244, 483, 4573, 1305, 7972,
|
|
2]) /* metro module 9399, dependencies: [31, 27, 661, 33, 4501, 697, 4080, 9059, 1962, 1244, 483, 4573, 1305, 7972, 2] */;
|