185 lines
9.7 KiB
TypeScript
185 lines
9.7 KiB
TypeScript
/* Metro module 10311; source: modules/guild_moderation/native/KickConfirm.tsx; dependencies: [57, 31, 27, 1867, 1878, 33, 4501, 697, 5463, 10302, 566, 6593, 10312, 4573, 1244, 3995, 7681, 4578, 2] */
|
|
function _fun80021(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#80021, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10497:6, offset: 0x01e69fa4, size: 640 bytes, params: 8, frame: 24
|
|
var object2;
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(57) /* metro dependency 57 */;
|
|
let value = importAll(31) /* metro dependency 31 */;
|
|
const value2 = require(27) /* metro dependency 27 */;
|
|
const env0_5 = value2.Image;
|
|
const env0_6 = value2.View;
|
|
const env0_7 = value2.ScrollView;
|
|
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
|
|
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
|
|
const value3 = require(33) /* metro dependency 33 */;
|
|
const env0_10 = value3.jsx;
|
|
const env0_11 = value3.jsxs;
|
|
const env0_12 = value3.Fragment;
|
|
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = createStylesModule.createStyles;
|
|
object2 = {};
|
|
const BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
|
|
object2.container = {backgroundColor: BACKGROUND_BASE_LOW};
|
|
const object4 = {};
|
|
let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object4.marginTop = PX_16;
|
|
const BACKGROUND_SURFACE_HIGH = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SURFACE_HIGH;
|
|
object4.backgroundColor = BACKGROUND_SURFACE_HIGH;
|
|
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
|
|
const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object4.paddingTop = PX_8;
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object4.paddingBottom = PX_16;
|
|
object4.alignItems = 'center';
|
|
object2.iconLabelBlock = object4;
|
|
const PX_96 = (importDefault(697) /* metro dependency 697: native */).space.PX_96;
|
|
object2.iconStyles = {height: 1.25 * PX_96};
|
|
const object6 = {};
|
|
const PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object6.marginTop = PX_12;
|
|
const PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
|
|
object6.marginBottom = PX_4;
|
|
const TEXT_FEEDBACK_CRITICAL = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_FEEDBACK_CRITICAL;
|
|
object6.color = TEXT_FEEDBACK_CRITICAL;
|
|
object2.redText = object6;
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object2.blurb = {marginVertical: PX_16};
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object2.errorText = {marginBottom: PX_16};
|
|
const env0_13 = Reflect.apply(createStyles, createStylesModule, [object2]);
|
|
value = value.memo(KickConfirm);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/guild_moderation/native/KickConfirm.tsx');
|
|
exports.default = value;
|
|
}
|
|
|
|
function KickConfirm({guildId, userId, onKick}) { // fn#80022, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10497:788, offset: 0x01e6a224, size: 1332 bytes, params: 2, frame: 44
|
|
var r9;
|
|
var r0;
|
|
var space;
|
|
var jsxRuntimeEnv0_12Binding;
|
|
var items2;
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
var formatToPlainString;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
var property2;
|
|
var object;
|
|
var items3;
|
|
var format;
|
|
var property3;
|
|
var object2;
|
|
var TextArea;
|
|
var object3;
|
|
var PX_16;
|
|
var UktD5J;
|
|
var object4;
|
|
var value;
|
|
const styles = useStyles();
|
|
const binding = env0_4;
|
|
const value3 = binding.useRef(null);
|
|
const value4 = binding.useRef(null);
|
|
const insets = (importDefault(5463) /* metro dependency 5463: useSafeAreaInsetsKeyboardAwareNative */)({includeKeyboardHeight: true}).insets;
|
|
(importDefault(10302) /* metro dependency 10302: useSafeAreaAvoidingInputsNative */)({insets: insets,
|
|
inputs: [{ref: value4, offset: {type: 'toBottom'}}], scrollViewRef: value3});
|
|
const guild = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildStore], function() {
|
|
return GuildStore.getGuild(guildId);
|
|
});
|
|
const env0_3 = guild;
|
|
const user = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
|
|
return UserStore.getUser(userId);
|
|
});
|
|
const env0_5 = binding.useRef('');
|
|
const [property, env0_6] = env0_3(binding.useState(function() {
|
|
return {'kicking': false, 'kickError': false};
|
|
}), 2);
|
|
const useCallback = binding.useCallback;
|
|
if (user != null) {
|
|
if (guild != null) {
|
|
var scrollViewBindingProps = {style: styles.container, ref: value3};
|
|
space = (importDefault(697) /* metro dependency 697: native */).space;
|
|
scrollViewBindingProps.contentContainerStyle = {paddingHorizontal: space.PX_24,
|
|
paddingBottom: insets.bottom};
|
|
jsxRuntimeEnv0_12Binding = jsxRuntimeEnv0_12;
|
|
var viewBindingProps = {style: styles.iconLabelBlock};
|
|
items2 = [<Image style={styles.iconStyles} source={importDefault(10312) /* metro dependency 10312 */} resizeMode="contain" />];
|
|
var textProps2 = {style: styles.redText, variant: 'text-md/semibold'};
|
|
formatToPlainString = intl.formatToPlainString;
|
|
property2 = t['1Ie87p'];
|
|
object = {};
|
|
object.user = (importDefault(3995) /* metro dependency 3995: UserUtils */).getName(user);
|
|
items2[1] = <Text {...textProps2}>{Reflect.apply(formatToPlainString, intl, [property2, object])}</Text>;
|
|
items2[2] = <Text variant="text-lg/bold" color="text-feedback-warning">{guild.name}</Text>;
|
|
items3 = [<View {...viewBindingProps}>{items2}</View>];
|
|
var textProps3 = {'style': null, 'variant': 'heading-md/normal', 'color': 'text-feedback-warning',
|
|
style: styles.blurb};
|
|
format = intl.format;
|
|
property3 = t['/yH0UT'];
|
|
object2 = {};
|
|
object2.user = (importDefault(3995) /* metro dependency 3995: UserUtils */).getName(user);
|
|
items3[1] = <Text {...textProps3}>{Reflect.apply(format, intl, [property3, object2])}</Text>;
|
|
TextArea = (require(7681) /* metro dependency 7681: TextAreaNative */).TextArea;
|
|
object3 = {ref: value4};
|
|
space = (importDefault(697) /* metro dependency 697: native */).space;
|
|
PX_16 = space.PX_16;
|
|
object3.containerStyle = {marginBottom: PX_16};
|
|
object3.label = intl.string(t['+2QEPt']);
|
|
object3.maxLength = 512;
|
|
object3.onChange = onChange_80028;
|
|
items3[2] = <TextArea {...object3} />;
|
|
space = (importDefault(697) /* metro dependency 697: native */).space;
|
|
PX_16 = space.PX_16;
|
|
items3[3] = <View style={{marginBottom: PX_16}}>{((Button) => <Button variant="destructive" text={intl.string(t['3glT6Z'])} onPress={Reflect.apply(useCallback,
|
|
|
|
|
|
binding, [_fun80026, [guild, onKick,
|
|
user]])} disabled={property.kicking} />)((require(4578) /* metro dependency 4578: ButtonNative */).Button)}</View>;
|
|
if (property.kickError) {
|
|
var textProps = {'style': null, 'variant': 'text-md/semibold', 'color': 'input-text-error-default',
|
|
style: styles.errorText};
|
|
format = intl.format;
|
|
UktD5J = (require(1244) /* metro dependency 1244: indexNative */).t.UktD5J;
|
|
object4 = {};
|
|
value = importDefault(3995) /* metro dependency 3995: UserUtils */;
|
|
object4.user = value.getName(user);
|
|
value = <Text {...textProps}>{Reflect.apply(format, intl, [UktD5J, object4])}</Text>;
|
|
r9 = value;
|
|
} else {
|
|
r9 = null;
|
|
}
|
|
items3[4] = r9;
|
|
value = <ScrollView {...scrollViewBindingProps}><>{items3}</></ScrollView>;
|
|
r0 = value;
|
|
} else {
|
|
r0 = null;
|
|
}
|
|
} else {
|
|
r0 = null;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun80026() { // fn#80026, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10497:1223, offset: 0x01e6a79e, size: 182 bytes, params: 1, frame: 17
|
|
var environment;
|
|
var binding;
|
|
var value4;
|
|
var value5;
|
|
var defaultImport;
|
|
var value6;
|
|
if (guild != null && user != null) {
|
|
binding = env0_6;
|
|
value4 = undefined;
|
|
binding({'kicking': true, 'kickError': false});
|
|
value5 = environment.__proto__;
|
|
defaultImport = importDefault(6593) /* metro dependency 6593: GuildActionCreators */;
|
|
value6 = defaultImport.kickUser(guild == null ? value4 : guild.id, user == null ? value4 : user.id,
|
|
env0_5.current);
|
|
value6.then(onKick).catch(_fun80027);
|
|
}
|
|
}
|
|
|
|
function _fun80027() { // fn#80027, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10497:1360, offset: 0x01e6a854, size: 30 bytes, params: 1, frame: 11
|
|
env1_6({'kicking': false, 'kickError': true});
|
|
}
|
|
|