Files
discord-decomp/sources/modules/accept_invite/native/AcceptInvite.tsx
T
2026-07-28 01:06:53 +03:00

201 lines
9.7 KiB
TypeScript

/* Metro module 12034; source: modules/accept_invite/native/AcceptInvite.tsx; dependencies: [57, 31, 27, 661, 33, 4501, 697, 1360, 3860, 5465, 12035, 12037, 1423, 1457, 12040, 1478, 6239, 2] */
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
import Native from '../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
import UseWindowDimensionsNative from '../../screen/useWindowDimensions.native.tsx'; /* Metro dependency 1478 */
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 ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
import * as GlobalUtilsModule from '../../../utils/GlobalUtils.tsx'; /* Metro dependency 1360 */
import * as UseTokenModule from '../../../design/tokens/native/useToken.tsx'; /* Metro dependency 3860 */
import * as CardNativeModule from '../../../design/components/Card/native/Card.native.tsx'; /* Metro dependency 6239 */
function _fun92494(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#92494, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12220:6, offset: 0x0208bb74, size: 482 bytes, params: 8, frame: 25
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = ReactNativeModule;
const env0_5 = value.ActivityIndicator;
const env0_6 = value.ImageBackground;
const env0_7 = value.View;
value = require(33) /* metro dependency 33 */;
const env0_9 = value.jsx;
const env0_10 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object = {};
const BACKGROUND_BASE_LOW = (Native).colors.BACKGROUND_BASE_LOW;
object.parentContainer = {'backgroundColor': null, 'alignItems': 'center', 'justifyContent': 'center',
backgroundColor: BACKGROUND_BASE_LOW};
object.imageStyle = {'marginVertical': 0, 'resizeMode': 'cover'};
const BACKGROUND_SURFACE_HIGH = (Native).colors.BACKGROUND_SURFACE_HIGH;
object.cardContainer = {'position': 'absolute', 'flex': 1, 'width': '90%', 'alignItems': 'center',
'justifyContent': 'center', 'padding': 0, backgroundColor: BACKGROUND_SURFACE_HIGH};
object.cardContent = {'padding': 16, 'flex': 1, 'justifyContent': 'center', 'alignItems': 'center', 'width': '100%'};
object.resolvingContainer = {padding: 64};
const env0_11 = Reflect.apply(createStyles, value, [object]);
object = {LOADING: 0};
object[0] = 'LOADING';
object.DETAILS = 1;
object[1] = 'DETAILS';
object.ERROR = 2;
object[2] = 'ERROR';
(FileImportTrackerModule).fileFinishedImporting('modules/accept_invite/native/AcceptInvite.tsx');
exports.default = AcceptInvite;
function InviteResolving() { // fn#92495, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12220:1211, offset: 0x0208bd56, size: 131 bytes, params: 1, frame: 17
const styles = useStyles();
const useToken = UseTokenModule.useToken;
const INTERACTIVE_TEXT_DEFAULT = (Native).colors.INTERACTIVE_TEXT_DEFAULT;
return (
<View style={styles.resolvingContainer}>
<ActivityIndicator color={Reflect.apply(useToken, UseTokenModule,
[INTERACTIVE_TEXT_DEFAULT])} size="large" />
</View>
);
}
function AcceptInviteCardComponent(a0) { // fn#92496, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12220:1386, offset: 0x0208bdd9, size: 290 bytes, params: 2, frame: 19
const invite = a0.invite;
const useState = ReactModule.useState;
const value3 = Module00057(Reflect.apply(useState, ReactModule, [getInviteState(invite)]), 2);
const property = value3[0];
const env0_2 = value3[1];
ReactModule.useEffect(_fun92497, [invite, property]);
if (invite != null) {
var DETAILS = env0_12.DETAILS;
if (DETAILS === property) {
return ((Component) => <Component {...a0} {...{['invite']: invite}} />)(importDefault(12035) /* metro dependency 12035: InviteDetails */);
}
var ERROR = env0_12.ERROR;
if (ERROR === property) {
return ((Component) => <Component {...a0} {...{['invite']: invite}} />)(importDefault(12037) /* metro dependency 12037: InviteError */);
}
}
return <InviteResolving />;
function _fun92497() { // fn#92497, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12220:1510, offset: 0x0208befb, size: 70 bytes, params: 1, frame: 14
const value = environment.__proto__;
const inviteState = getInviteState(invite);
if (inviteState !== env0_1) {
(require(5465) /* metro dependency 5465: DeprecatedLayoutAnimation */).DeprecatedLayoutAnimation();
env0_2(inviteState);
}
}
}
function getInviteState(a0) { // fn#92498, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12220:817, offset: 0x0208bf41, size: 315 bytes, params: 2, frame: 14
let value = undefined;
let state = a0 == null ? value : a0.state;
const r2 = state == null && (a0 == null ? value : a0.channel) == null;
if (a0 == null) {
value = environment;
return env0_12.LOADING;
}
if (a0.state == null) {
value = environment;
return env0_12.LOADING;
}
if (r2) {
value = environment;
return env0_12.LOADING;
}
state = a0.state;
const RESOLVED = InviteStates.RESOLVED;
if (RESOLVED === state) {
return env0_12.DETAILS;
}
const ACCEPTED = InviteStates.ACCEPTED;
if (ACCEPTED === state) {
return env0_12.DETAILS;
}
const EXPIRED = InviteStates.EXPIRED;
if (EXPIRED === state) {
return env0_12.ERROR;
}
const BANNED = InviteStates.BANNED;
if (BANNED === state) {
return env0_12.ERROR;
}
const ERROR = InviteStates.ERROR;
if (ERROR === state) {
return env0_12.ERROR;
}
const RESOLVING = InviteStates.RESOLVING;
if (RESOLVING === state) {
return env0_12.LOADING;
}
const APP_NOT_OPENED = InviteStates.APP_NOT_OPENED;
if (APP_NOT_OPENED === state) {
return env0_12.LOADING;
}
const APP_OPENED = InviteStates.APP_OPENED;
if (APP_OPENED === state) {
return env0_12.LOADING;
}
const APP_OPENING = InviteStates.APP_OPENING;
if (APP_OPENING === state) {
return env0_12.LOADING;
}
const ACCEPTING = InviteStates.ACCEPTING;
if (ACCEPTING === state) {
return env0_12.LOADING;
}
(GlobalUtilsModule).assertNever(state);
return value;
}
function AcceptInvite(a0) { // fn#92499, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12220:1871, offset: 0x0208c07c, size: 448 bytes, params: 2, frame: 26
var r7;
var object;
var defaultImport;
var getGuildSplashSource;
var moduleValue;
const invite = a0.invite;
const value = Object.create(null);
value.invite = 0;
const value2 = copyDataProperties({}, a0, value, invite);
const value4 = undefined;
const styles = useStyles();
const {height, width} = (UseWindowDimensionsNative)();
const guild = (invite ?? ({})).guild;
if ((guild == null ? value4 : guild.splash) == null) {
r7 = importDefault(12040) /* metro dependency 12040 */;
} else {
defaultImport = importDefault(1423) /* metro dependency 1423: AvatarUtils */;
getGuildSplashSource = defaultImport.getGuildSplashSource;
object = {};
object.id = guild.id;
object.splash = guild.splash;
moduleValue = require(1457) /* metro dependency 1457: ImageLoaderUtils */;
object.size = width * moduleValue.getDevicePixelRatio();
r7 = Reflect.apply(getGuildSplashSource, defaultImport,
[object]) ?? (importDefault(12040) /* metro dependency 12040 */);
}
const items2 = [styles.parentContainer];
items2[1] = {height: height, width: width};
const imageBackground = (
<ImageBackground
source={r7}
imageStyle={styles.imageStyle}
style={{height: height, width: width}}
/>
);
const Card = (CardNativeModule).Card;
return (
<View style={items2}>
{imageBackground}
<Card style={styles.cardContainer}>
<View style={styles.cardContent}>
<AcceptInviteCardComponent invite={invite} {...value2} />
</View>
</Card>
</View>
);
}
}
global.__d(_fun92494, 12034, [57, 31, 27, 661, 33, 4501, 697, 1360, 3860, 5465, 12035, 12037, 1423, 1457, 12040,
1478, 6239,
2]) /* metro module 12034, dependencies: [57, 31, 27, 661, 33, 4501, 697, 1360, 3860, 5465, 12035, 12037, 1423, 1457, 12040, 1478, 6239, 2] */;