Files
discord-decomp/sources/modules/oauth2/native/SuccessResult.tsx
T
2026-07-27 16:20:00 +03:00

211 lines
12 KiB
TypeScript

/* Metro module 10204; source: modules/oauth2/native/SuccessResult.tsx; dependencies: [31, 27, 1379, 3784, 1934, 661, 1483, 33, 4501, 697, 7717, 1244, 5080, 6947, 683, 566, 4080, 4015, 1583, 6618, 10205, 4573, 4578, 2] */
function _fun79334(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#79334, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10390:6, offset: 0x01e4e507, size: 519 bytes, params: 8, frame: 23
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importAll(31) /* metro dependency 31 */;
let value = require(27) /* metro dependency 27 */;
const env0_4 = value.Image;
const env0_5 = value.View;
const env0_6 = value.ScrollView;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const permissionStore = importDefault(3784) /* metro dependency 3784: PermissionStore */;
const selectedChannelStore = importDefault(1934) /* metro dependency 1934: SelectedChannelStore */;
value = require(661) /* metro dependency 661: Constants */;
const env0_10 = value.AnalyticEvents;
const env0_11 = value.Permissions;
const env0_12 = (require(1483) /* metro dependency 1483: AppLauncherNativeConstants */).AppLauncherRouteName;
value = require(33) /* metro dependency 33 */;
const env0_13 = value.jsx;
const env0_14 = value.jsxs;
const env0_15 = value.Fragment;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object2 = {};
const BACKGROUND_BASE_LOWER = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWER;
object2.container = {flex: 1, backgroundColor: BACKGROUND_BASE_LOWER};
object2.scrollView = {flex: 1};
const BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
object2.scrollViewContentContainer = {'height': '100%', 'backgroundColor': null, 'alignItems': 'center',
'justifyContent': 'center', backgroundColor: BACKGROUND_BASE_LOW};
object2.inner = {'flexDirection': 'column', 'alignItems': 'center', 'justifyContent': 'center',
'paddingHorizontal': 16};
object2.text = {'marginTop': 24, 'paddingHorizontal': 40, 'textAlign': 'center'};
object2.footer = {'flexDirection': 'column', 'justifyContent': 'space-between', 'padding': 16, 'gap': 16};
object2.footerLandscape = {'flexDirection': 'row-reverse', 'padding': 16};
object2.footerPortrait = {'flexDirection': 'column', 'padding': 16};
const env0_16 = Reflect.apply(createStyles, value, [object2]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/oauth2/native/SuccessResult.tsx');
exports.default = SuccessResultModal;
}
function SuccessResultModal({guild, application}) { // fn#79335, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10390:981, offset: 0x01e4e70e, size: 1253 bytes, params: 2, frame: 39
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
let env0_3 = undefined;
const styles = useStyles();
const deviceOrientationModule = require(7717) /* metro dependency 7717: DeviceOrientation */;
const useStore = deviceOrientationModule.useStore;
const orientation = Reflect.apply(useStore, deviceOrientationModule, []).orientation;
let binding = env0_3;
const value3 = binding.useMemo(_fun79336, [application, guild]);
const value5 = binding.useCallback(_fun79337, [guild, application?.id]);
const channelId = (require(566) /* metro dependency 566: flux */).useStateFromStores([SelectedChannelStore],
function() {
return SelectedChannelStore.getChannelId();
});
env0_3 = (require(566) /* metro dependency 566: flux */).useStateFromStores([ChannelStore], function() {
return ChannelStore.getChannel(channelId);
});
binding = env0_3;
const value6 = binding.useCallback(_fun79340, [application, channelId]);
const value7 = binding.useCallback(function() {
var value2 = undefined;
importDefault(dependencyMap[12]).pop();
var defaultImport2 = importDefault(dependencyMap[14]);
var track = defaultImport2.track;
var OAUTH2_AUTHORIZE_SUCCESS_CLOSE_CLICKED = AnalyticEvents.OAUTH2_AUTHORIZE_SUCCESS_CLOSE_CLICKED;
Reflect.apply(track, defaultImport2, [OAUTH2_AUTHORIZE_SUCCESS_CLOSE_CLICKED,
{application_id: application == null ? value2 : application.id}]);
return value2;
}, [application?.id]);
env0_3.useEffect(function() {
var value2 = undefined;
var defaultImport = importDefault(dependencyMap[14]);
var track = defaultImport.track;
var OAUTH2_AUTHORIZE_SUCCESS_VIEWED = AnalyticEvents.OAUTH2_AUTHORIZE_SUCCESS_VIEWED;
Reflect.apply(track, defaultImport, [OAUTH2_AUTHORIZE_SUCCESS_VIEWED,
{application_id: application == null ? value2 : application.id}]);
return value2;
}, [application?.id]);
const value8 = (require(566) /* metro dependency 566: flux */).useStateFromStores([PermissionStore], function() {
var SEND_MESSAGES = Permissions.SEND_MESSAGES;
return PermissionStore.can(SEND_MESSAGES, channel);
});
const SafeAreaPaddingView = (require(6618) /* metro dependency 6618: SafeAreaView */).SafeAreaPaddingView;
const items2 = [<Image source={importDefault(10205) /* metro dependency 10205 */} />];
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
items2[1] = <Text style={styles.text} variant="text-lg/medium">{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.se5gLj)}</Text>;
items2[2] = value3 != null ? <Text style={styles.text} variant="text-sm/normal">{value3}</Text> : null;
const scrollView = <ScrollView style={styles.scrollView} contentContainerStyle={styles.scrollViewContentContainer}><View style={styles.inner}>{items2}</View></ScrollView>;
const items3 = [styles.footer];
const OrientationType = deviceOrientationModule.OrientationType;
const LANDSCAPE = OrientationType.LANDSCAPE;
items3[1] = orientation === LANDSCAPE ? styles.footerLandscape : styles.footerPortrait;
return (
<SafeAreaPaddingView bottom style={styles.container}>
{scrollView}
<View style={items3}>
<>
{guild != null ? <Button size="lg" text={intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t.UdYYP3,
{guildName: guild?.name})} onPress={value5} /> : null}
{channelId != null && value8 ? <Button size="lg" text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['0cCDKP'])} onPress={value6} /> : null}
<Button
size="lg"
variant={guild != null ? 'tertiary' : undefined}
text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.cpT0Cq)}
onPress={value7}
/>
</>
</View>
</SafeAreaPaddingView>
);
}
function _fun79336() { // fn#79336, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10390:1091, offset: 0x01e4ebf3, size: 304 bytes, params: 1, frame: 20
var name;
var r1;
var r0;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
var value2;
var format;
var object2;
var value4;
var value5;
var IlF6IY;
var value;
if (application != null) {
if (guild != null) {
value4 = environment.__proto__;
value5 = undefined;
format = intl.format;
IlF6IY = t.IlF6IY;
object2 = {};
name = application == null ? value5 : application.name;
object2.installedApplicationName = name;
name = guild == null ? value5 : guild.name;
object2.guildName = name;
r1 = Reflect.apply(format, intl, [IlF6IY, object2]);
} else {
value2 = environment.__proto__;
r1 = intl.format(t.vTVC5T, {installedApplicationName: application?.name});
}
r0 = r1;
} else {
value = environment.__proto__;
value = intl.string(t['Dp+rgP']);
r0 = value;
}
return r0;
}
function _fun79337() { // fn#79337, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10390:1389, offset: 0x01e4ed23, size: 216 bytes, params: 1, frame: 18
var value3;
var moduleValue;
var transitionToGuild;
var defaultImport2;
var track;
var OAUTH2_AUTHORIZE_SUCCESS_GO_TO_GUILD_CLICKED;
var object2;
const guildBinding = guild;
const value2 = undefined;
let id = guildBinding == null ? value2 : guild.id;
if (id != null) {
value3 = environment.__proto__;
(importDefault(5080) /* metro dependency 5080: ModalActionCreators */).pop();
moduleValue = require(6947) /* metro dependency 6947: transitionToGuildNative */;
transitionToGuild = moduleValue.transitionToGuild;
id = guild == null ? value2 : guild.id;
Reflect.apply(transitionToGuild, moduleValue, [id]);
defaultImport2 = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
track = defaultImport2.track;
OAUTH2_AUTHORIZE_SUCCESS_GO_TO_GUILD_CLICKED = AnalyticEvents.OAUTH2_AUTHORIZE_SUCCESS_GO_TO_GUILD_CLICKED;
object2 = {};
id = application == null ? value2 : application.id;
object2.application_id = id;
id = guild == null ? value2 : guild.id;
object2.guild_id = id;
Reflect.apply(track, defaultImport2, [OAUTH2_AUTHORIZE_SUCCESS_GO_TO_GUILD_CLICKED, object2]);
}
return value2;
}
function _fun79340() { // fn#79340, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10390:1776, offset: 0x01e4ee28, size: 165 bytes, params: 1, frame: 15
var defaultImport3;
(importDefault(5080) /* metro dependency 5080: ModalActionCreators */).pop();
(importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */).hideActionSheet();
if (channelId != null && application != null) {
defaultImport3 = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
defaultImport3.track(AnalyticEvents.OAUTH2_AUTHORIZE_SUCCESS_OPEN_APP_CLICKED,
{application_id: application.id});
global.setImmediate(_fun79341);
}
}
function _fun79341() { // fn#79341, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10390:1938, offset: 0x01e4eecd, size: 124 bytes, params: 1, frame: 16
var openCustomKeyboard;
var object2;
const bestActiveInput = (require(4015) /* metro dependency 4015: ChatInputUtils */).getBestActiveInput();
if (bestActiveInput != null) {
openCustomKeyboard = bestActiveInput.openCustomKeyboard;
object2 = {};
object2.type = (require(1583) /* metro dependency 1583: KeyboardTypes */).KeyboardTypes.APP_LAUNCHER;
value = environment.__proto__;
object2.context = {initialRouteName: AppLauncherRouteName.APPLICATION_VIEW, application: application};
Reflect.apply(openCustomKeyboard, bestActiveInput, [object2]);
}
}