227 lines
12 KiB
TypeScript
227 lines
12 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] */
|
|
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import GuildStore from '../../../stores/GuildStore.tsx'; /* Metro dependency 1867 */
|
|
import UserStore from '../../../stores/UserStore.tsx'; /* Metro dependency 1878 */
|
|
import UseSafeAreaInsetsKeyboardAwareNative from '../../safe_area/useSafeAreaInsetsKeyboardAware.native.tsx'; /* Metro dependency 5463 */
|
|
import UseSafeAreaAvoidingInputsNative from '../../safe_area/useSafeAreaAvoidingInputs.native.tsx'; /* Metro dependency 10302 */
|
|
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 CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
|
|
import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
|
|
|
|
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
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactModule;
|
|
const createStyles = CreateStylesModule.createStyles;
|
|
object = {};
|
|
const BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
|
|
object.container = {backgroundColor: BACKGROUND_BASE_LOW};
|
|
const object3 = {};
|
|
let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object3.marginTop = PX_16;
|
|
const BACKGROUND_SURFACE_HIGH = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SURFACE_HIGH;
|
|
object3.backgroundColor = BACKGROUND_SURFACE_HIGH;
|
|
object3.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
|
|
const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object3.paddingTop = PX_8;
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object3.paddingBottom = PX_16;
|
|
object3.alignItems = 'center';
|
|
object.iconLabelBlock = object3;
|
|
const PX_96 = (importDefault(697) /* metro dependency 697: native */).space.PX_96;
|
|
object.iconStyles = {height: 1.25 * PX_96};
|
|
const object5 = {};
|
|
const PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object5.marginTop = PX_12;
|
|
const PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
|
|
object5.marginBottom = PX_4;
|
|
const TEXT_FEEDBACK_CRITICAL = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_FEEDBACK_CRITICAL;
|
|
object5.color = TEXT_FEEDBACK_CRITICAL;
|
|
object.redText = object5;
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object.blurb = {marginVertical: PX_16};
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object.errorText = {marginBottom: PX_16};
|
|
const env0_13 = Reflect.apply(createStyles, CreateStylesModule, [object]);
|
|
value = value.memo(KickConfirm);
|
|
(FileImportTrackerModule).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 = (TextModule).Text;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
var formatToPlainString;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
var property2;
|
|
var object5;
|
|
var items3;
|
|
var format;
|
|
var property3;
|
|
var object6;
|
|
var TextArea;
|
|
var object7;
|
|
var PX_16;
|
|
var UktD5J;
|
|
var object8;
|
|
var value;
|
|
const styles = useStyles();
|
|
const binding = env0_4;
|
|
const value3 = binding.useRef(null);
|
|
const value4 = binding.useRef(null);
|
|
const insets = (UseSafeAreaInsetsKeyboardAwareNative)({includeKeyboardHeight: true}).insets;
|
|
(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 guild2 = 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] = guild2(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'];
|
|
object5 = {};
|
|
object5.user = (importDefault(3995) /* metro dependency 3995: UserUtils */).getName(user);
|
|
items2[1] = (
|
|
<Text {...textProps2}>
|
|
{Reflect.apply(formatToPlainString, intl, [property2, object5])}
|
|
</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'];
|
|
object6 = {};
|
|
object6.user = (importDefault(3995) /* metro dependency 3995: UserUtils */).getName(user);
|
|
items3[1] = (
|
|
<Text {...textProps3}>
|
|
{Reflect.apply(format, intl, [property3, object6])}
|
|
</Text>
|
|
);
|
|
TextArea = (require(7681) /* metro dependency 7681: TextAreaNative */).TextArea;
|
|
object7 = {ref: value4};
|
|
space = (importDefault(697) /* metro dependency 697: native */).space;
|
|
PX_16 = space.PX_16;
|
|
object7.containerStyle = {marginBottom: PX_16};
|
|
object7.label = intl.string(t['+2QEPt']);
|
|
object7.maxLength = 512;
|
|
object7.onChange = onChange_80028;
|
|
items3[2] = <TextArea {...object7} />;
|
|
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;
|
|
object8 = {};
|
|
value = importDefault(3995) /* metro dependency 3995: UserUtils */;
|
|
object8.user = value.getName(user);
|
|
value = (
|
|
<Text {...textProps}>
|
|
{Reflect.apply(format, intl, [UktD5J, object8])}
|
|
</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});
|
|
}
|
|
|
|
}
|
|
|
|
function KickConfirmOnChange(a0) { // fn#80028, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10497:2236, owner: KickConfirm.onChange, offset: 0x00e6e0d4, size: 20 bytes, params: 2, frame: 2
|
|
env0_5.current = a0;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun80021, 10311, [57, 31, 27, 1867, 1878, 33, 4501, 697, 5463, 10302, 566, 6593, 10312, 4573, 1244,
|
|
3995, 7681, 4578,
|
|
2]) /* metro module 10311, dependencies: [57, 31, 27, 1867, 1878, 33, 4501, 697, 5463, 10302, 566, 6593, 10312, 4573, 1244, 3995, 7681, 4578, 2] */;
|