306 lines
16 KiB
TypeScript
306 lines
16 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] */
|
|
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 */
|
|
import * as TableRadioRowNativeModule from '../../../design/components/TableRow/native/TableRadioRow.native.tsx'; /* Metro dependency 7987 */
|
|
|
|
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
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactModule;
|
|
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 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};
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object.blurb = {marginVertical: PX_16};
|
|
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;
|
|
object.redText = object6;
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object.errorText = {marginBottom: PX_16};
|
|
const env0_14 = Reflect.apply(createStyles, CreateStylesModule, [object]);
|
|
value = value.memo(BanConfirm);
|
|
(FileImportTrackerModule).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 = (TextModule).Text;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
var format;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
var Qd6w7T;
|
|
var object6;
|
|
var items3;
|
|
var property2;
|
|
var object7;
|
|
var TableRadioGroup;
|
|
var string;
|
|
var TextArea;
|
|
var object8;
|
|
var PX_16;
|
|
var object9;
|
|
var Button;
|
|
var object10;
|
|
var value;
|
|
const styles = useStyles();
|
|
let 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(0);
|
|
const env0_6 = binding.useRef('');
|
|
let [property, env0_7] = guild2(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;
|
|
object6 = {};
|
|
object6.username = (importDefault(3995) /* metro dependency 3995: UserUtils */).getName(user);
|
|
items2[1] = (
|
|
<Text {...textProps2}>
|
|
{Reflect.apply(format, intl, [Qd6w7T, object6])}
|
|
</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'];
|
|
object7 = {};
|
|
object7.user = (importDefault(3995) /* metro dependency 3995: UserUtils */).getName(user);
|
|
items3[1] = (
|
|
<Text {...textProps3}>
|
|
{Reflect.apply(format, intl, [property2, object7])}
|
|
</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;
|
|
object8 = {ref: value4};
|
|
space = (importDefault(697) /* metro dependency 697: native */).space;
|
|
PX_16 = space.PX_16;
|
|
object8.containerStyle = {marginVertical: PX_16};
|
|
object8.label = intl.string(t.w4Ivys);
|
|
object8.maxLength = 512;
|
|
object8.onChange = onChange_80046;
|
|
items3[3] = <TextArea {...object8} />;
|
|
object9 = {};
|
|
space = (importDefault(697) /* metro dependency 697: native */).space;
|
|
PX_16 = space.PX_16;
|
|
object9.style = {marginBottom: PX_16};
|
|
Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
|
|
string = intl.string;
|
|
items3[4] = (
|
|
<View {...object9}>
|
|
<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'];
|
|
object10 = {};
|
|
value = importDefault(3995) /* metro dependency 3995: UserUtils */;
|
|
object10.user = value.getName(user);
|
|
value = (
|
|
<Text {...textProps}>
|
|
{Reflect.apply(format, intl, [property, object10])}
|
|
</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 _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});
|
|
}
|
|
|
|
}
|
|
|
|
function BanConfirmOnChange(a0) { // fn#80044, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10499:2771, owner: BanConfirm.onChange, offset: 0x00e6e0d4, size: 20 bytes, params: 2, frame: 2
|
|
env0_5.current = a0;
|
|
}
|
|
|
|
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 = (TableRadioRowNativeModule).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;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun80030, 10313, [57, 31, 27, 1867, 1878, 33, 1244, 672, 4501, 697, 5463, 10302, 566, 6593, 10314, 4573,
|
|
3995, 7988, 7987, 7681, 4578,
|
|
2]) /* metro module 10313, dependencies: [57, 31, 27, 1867, 1878, 33, 1244, 672, 4501, 697, 5463, 10302, 566, 6593, 10314, 4573, 3995, 7988, 7987, 7681, 4578, 2] */;
|