252 lines
13 KiB
TypeScript
252 lines
13 KiB
TypeScript
/* Metro module 10313; source: modules/guild_moderation/native/BanConfirm.tsx; dependencies: [57, 31, 27, 1867, 1878, 33, 1244, 672, 4501, 697, 5463, 10302, 566, 6593, 10314, 4573, 3995, 7988, 7987, 7681, 4578, 2] */
|
|
function _fun80030(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#80030, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10499:6, offset: 0x01e6a8b8, size: 961 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 items2 = [{value: 0, getLabel: function() {
|
|
return require(dependencyMap[6]).intl.string(require(dependencyMap[6]).t['4obaMS']);
|
|
}}];
|
|
let Seconds = (importDefault(672) /* metro dependency 672: Durations */).Seconds;
|
|
let HOUR = Seconds.HOUR;
|
|
items2[1] = {value: 1 * HOUR, getLabel: function() {
|
|
return require(dependencyMap[6]).intl.string(require(dependencyMap[6]).t.RKpitY);
|
|
}};
|
|
Seconds = (importDefault(672) /* metro dependency 672: Durations */).Seconds;
|
|
HOUR = Seconds.HOUR;
|
|
items2[2] = {value: 6 * HOUR, getLabel: function() {
|
|
return require(dependencyMap[6]).intl.string(require(dependencyMap[6]).t['8WfJZ8']);
|
|
}};
|
|
Seconds = (importDefault(672) /* metro dependency 672: Durations */).Seconds;
|
|
HOUR = Seconds.HOUR;
|
|
items2[3] = {value: 12 * HOUR, getLabel: function() {
|
|
return require(dependencyMap[6]).intl.string(require(dependencyMap[6]).t.p1up7u);
|
|
}};
|
|
Seconds = (importDefault(672) /* metro dependency 672: Durations */).Seconds;
|
|
let DAY = Seconds.DAY;
|
|
items2[4] = {value: 1 * DAY, getLabel: function() {
|
|
return require(dependencyMap[6]).intl.string(require(dependencyMap[6]).t.XuVkkD);
|
|
}};
|
|
Seconds = (importDefault(672) /* metro dependency 672: Durations */).Seconds;
|
|
DAY = Seconds.DAY;
|
|
items2[5] = {value: 3 * DAY, getLabel: function() {
|
|
return require(dependencyMap[6]).intl.string(require(dependencyMap[6]).t['gMcDS+']);
|
|
}};
|
|
Seconds = (importDefault(672) /* metro dependency 672: Durations */).Seconds;
|
|
DAY = Seconds.DAY;
|
|
items2[6] = {value: 7 * DAY, getLabel: function() {
|
|
return require(dependencyMap[6]).intl.string(require(dependencyMap[6]).t.FA7IUk);
|
|
}};
|
|
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};
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object2.blurb = {marginVertical: PX_16};
|
|
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;
|
|
object2.redText = object5;
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object2.errorText = {marginBottom: PX_16};
|
|
const env0_14 = Reflect.apply(createStyles, createStylesModule, [object2]);
|
|
value = value.memo(BanConfirm);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/guild_moderation/native/BanConfirm.tsx');
|
|
exports.default = value;
|
|
}
|
|
|
|
function BanConfirm({guildId, userId, onBan}) { // fn#80038, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10499:1374, offset: 0x01e6ae2b, size: 1486 bytes, params: 2, frame: 45
|
|
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 format;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
var Qd6w7T;
|
|
var object;
|
|
var items3;
|
|
var property2;
|
|
var object2;
|
|
var TableRadioGroup;
|
|
var string;
|
|
var TextArea;
|
|
var object3;
|
|
var PX_16;
|
|
var object4;
|
|
var Button;
|
|
var object5;
|
|
var value;
|
|
const styles = useStyles();
|
|
let 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(0);
|
|
const env0_6 = binding.useRef('');
|
|
let [property, env0_7] = env0_3(binding.useState(function() {
|
|
return {'banning': false, 'banError': 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(10314) /* metro dependency 10314 */} resizeMode="contain" />];
|
|
var textProps2 = {style: styles.redText, variant: 'text-md/semibold'};
|
|
format = intl.format;
|
|
Qd6w7T = t.Qd6w7T;
|
|
object = {};
|
|
object.username = (importDefault(3995) /* metro dependency 3995: UserUtils */).getName(user);
|
|
items2[1] = <Text {...textProps2}>{Reflect.apply(format, intl, [Qd6w7T, 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;
|
|
property2 = t['8jV9fx'];
|
|
object2 = {};
|
|
object2.user = (importDefault(3995) /* metro dependency 3995: UserUtils */).getName(user);
|
|
items3[1] = <Text {...textProps3}>{Reflect.apply(format, intl, [property2, object2])}</Text>;
|
|
TableRadioGroup = (require(7988) /* metro dependency 7988: TableRadioGroupNative */).TableRadioGroup;
|
|
string = intl.string;
|
|
binding = env0_13;
|
|
items3[2] = <TableRadioGroup title={Reflect.apply(string, intl,
|
|
[t['8l3W0y']])} defaultValue={binding[0].value} onChange={onChange_80044} hasIcons={false}>{binding.map(_fun80045)}</TableRadioGroup>;
|
|
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 = {marginVertical: PX_16};
|
|
object3.label = intl.string(t.w4Ivys);
|
|
object3.maxLength = 512;
|
|
object3.onChange = onChange_80046;
|
|
items3[3] = <TextArea {...object3} />;
|
|
object4 = {};
|
|
space = (importDefault(697) /* metro dependency 697: native */).space;
|
|
PX_16 = space.PX_16;
|
|
object4.style = {marginBottom: PX_16};
|
|
Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
|
|
string = intl.string;
|
|
items3[4] = <View {...object4}><Button variant="destructive" text={Reflect.apply(string, intl,
|
|
[t['5MBJ5M']])} onPress={Reflect.apply(useCallback, binding, [_fun80042, [guild, user,
|
|
onBan]])} disabled={property.banning} /></View>;
|
|
if (property.banError) {
|
|
var textProps = {'style': null, 'variant': 'text-md/semibold', 'color': 'input-text-error-default',
|
|
style: styles.errorText};
|
|
format = intl.format;
|
|
property = (require(1244) /* metro dependency 1244: indexNative */).t['/K6eer'];
|
|
object5 = {};
|
|
value = importDefault(3995) /* metro dependency 3995: UserUtils */;
|
|
object5.user = value.getName(user);
|
|
value = <Text {...textProps}>{Reflect.apply(format, intl, [property, object5])}</Text>;
|
|
r9 = value;
|
|
} else {
|
|
r9 = null;
|
|
}
|
|
items3[5] = r9;
|
|
value = <ScrollView {...scrollViewBindingProps}><>{items3}</></ScrollView>;
|
|
r0 = value;
|
|
} else {
|
|
r0 = null;
|
|
}
|
|
} else {
|
|
r0 = null;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun80042() { // fn#80042, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10499:1824, offset: 0x01e6b409, size: 178 bytes, params: 1, frame: 18
|
|
var environment;
|
|
var binding;
|
|
var value4;
|
|
var defaultImport;
|
|
var banUser;
|
|
var id;
|
|
var id2;
|
|
var current;
|
|
var value5;
|
|
var value6;
|
|
if (guild != null && user != null) {
|
|
binding = env0_7;
|
|
binding({'banning': true, 'banError': false});
|
|
value4 = environment.__proto__;
|
|
defaultImport = importDefault(6593) /* metro dependency 6593: GuildActionCreators */;
|
|
banUser = defaultImport.banUser;
|
|
id = guild.id;
|
|
id2 = user.id;
|
|
binding = env1_13;
|
|
current = env0_5.current;
|
|
value5 = binding[current].value;
|
|
current = env0_6.current;
|
|
value6 = Reflect.apply(banUser, defaultImport, [id, id2, value5, current]);
|
|
value6.then(onBan).catch(_fun80043);
|
|
}
|
|
}
|
|
|
|
function _fun80045(a0, a1) { // fn#80045, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10499:2816, offset: 0x01e6b4d9, size: 70 bytes, params: 3, frame: 17
|
|
const TableRadioRow = (require(7987) /* metro dependency 7987: TableRadioRowNative */).TableRadioRow;
|
|
return (
|
|
<TableRadioRow
|
|
value={a1}
|
|
label={a0.getLabel()}
|
|
key={a1}
|
|
/>
|
|
);
|
|
}
|
|
|
|
function BanConfirmOnChange_80046(a0) { // fn#80046, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10499:3031, owner: BanConfirm.onChange, offset: 0x01e6b51f, size: 20 bytes, params: 2, frame: 2
|
|
env0_6.current = a0;
|
|
}
|
|
|
|
function _fun80043() { // fn#80043, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10499:1949, offset: 0x01e6b4bb, size: 30 bytes, params: 1, frame: 11
|
|
env1_7({'banning': false, 'banError': true});
|
|
}
|
|
|