Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4825.js (118.4 MB)
149 lines
5.7 KiB
TypeScript
149 lines
5.7 KiB
TypeScript
// Module ID: 12868
|
|
// Function ID: 12869
|
|
// Name: AcceptInvite
|
|
// Dependencies: [32, 19, 17, 1074, 21, 4640, 576, 1370, 4341, 5669, 12869, 12872, 1397, 1431, 12877, 1478, 5695, 2]
|
|
// Exports: default
|
|
|
|
// Module 12868 (AcceptInvite)
|
|
import nativeDefault from "native" /* 576 */;
|
|
import GlobalUtils from "GlobalUtils" /* 1370 */;
|
|
import ImageLoaderUtils from "ImageLoaderUtils" /* 1431 */;
|
|
import useWindowDimensionsDefault from "useWindowDimensions" /* 1478 */;
|
|
import useToken from "useToken" /* 4341 */;
|
|
import DeprecatedLayoutAnimation from "DeprecatedLayoutAnimation" /* 5669 */;
|
|
import Card from "Card" /* 5695 */;
|
|
import _slicedToArray from "module_32" /* 32 */;
|
|
import noop from "module_19" /* 19 */;
|
|
|
|
require = fn;
|
|
function getInviteState(invite) {
|
|
let state1;
|
|
if (invite != null) {
|
|
state1 = invite.state;
|
|
}
|
|
let tmp2 = null == state1;
|
|
if (tmp2) {
|
|
let channel;
|
|
if (invite != null) {
|
|
channel = invite.channel;
|
|
}
|
|
tmp2 = null == channel;
|
|
}
|
|
if (null != invite) {
|
|
if (null != invite.state) {
|
|
if (!tmp2) {
|
|
const state = invite.state;
|
|
if (InviteStates.RESOLVED !== state) {
|
|
if (tmp4.ACCEPTED !== state) {
|
|
if (tmp4.EXPIRED !== state) {
|
|
if (tmp4.BANNED !== state) {
|
|
if (tmp4.ERROR !== state) {
|
|
if (tmp4.RESOLVING !== state) {
|
|
if (tmp4.APP_NOT_OPENED !== state) {
|
|
if (tmp4.APP_OPENED !== state) {
|
|
if (tmp4.APP_OPENING !== state) {
|
|
if (tmp4.ACCEPTING !== state) {
|
|
GlobalUtils.assertNever(state);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return constants.LOADING;
|
|
}
|
|
}
|
|
}
|
|
return constants.ERROR;
|
|
}
|
|
}
|
|
return constants.DETAILS;
|
|
}
|
|
}
|
|
}
|
|
return constants.LOADING;
|
|
}
|
|
function InviteResolving() {
|
|
const tmp = closure_11();
|
|
const obj2 = { style: tmp.resolvingContainer, children: null };
|
|
obj2.children = React7(hasOwnProperty, { color: useToken.useToken(nativeDefault.colors.INTERACTIVE_TEXT_DEFAULT), size: "large" });
|
|
return React7(React5, obj2);
|
|
}
|
|
function AcceptInviteCardComponent(invite) {
|
|
invite = invite.invite;
|
|
[first, dependencyMap] = noop.useState(getInviteState(invite));
|
|
const items = [invite, first];
|
|
const effect = noop.useEffect(() => {
|
|
const tmp = getInviteState(invite);
|
|
if (tmp !== first) {
|
|
const result = DeprecatedLayoutAnimation.DeprecatedLayoutAnimation();
|
|
closure_2(tmp);
|
|
}
|
|
}, items);
|
|
if (null == invite) {
|
|
return closure_9(InviteResolving, {});
|
|
} else if (constants.DETAILS === first) {
|
|
const obj2 = {};
|
|
const merged = Object.assign(invite);
|
|
obj2.invite = invite;
|
|
return closure_9(first(12869), obj2);
|
|
} else if (tmp22.ERROR === first) {
|
|
let obj = {};
|
|
const merged1 = Object.assign(invite);
|
|
obj.invite = invite;
|
|
return closure_9(first(12872), obj);
|
|
} else {
|
|
return closure_9(InviteResolving, {});
|
|
}
|
|
}
|
|
get_ActivityIndicator = fn(17);
|
|
({ ActivityIndicator: hasOwnProperty, ImageBackground: metroRequire, View: closure_7 } = get_ActivityIndicator);
|
|
const InviteStates = fn(1074).InviteStates;
|
|
const jsxProd = fn(21);
|
|
({ jsx: closure_9, jsxs: c10 } = jsxProd);
|
|
const createStyles = fn(4640);
|
|
let obj2 = { parentContainer: { backgroundColor: nativeDefault.colors.BACKGROUND_BASE_LOW, alignItems: "center", justifyContent: "center" }, imageStyle: { marginVertical: 0, resizeMode: "cover" }, cardContainer: null, cardContent: null, resolvingContainer: null };
|
|
const obj3 = { backgroundColor: nativeDefault.colors.BACKGROUND_BASE_LOW, alignItems: "center", justifyContent: "center" };
|
|
obj2.cardContainer = { position: "absolute", flex: 1, width: "90%", alignItems: "center", justifyContent: "center", padding: 0, backgroundColor: nativeDefault.colors.BACKGROUND_SURFACE_HIGH };
|
|
obj2.cardContent = { padding: 16, flex: 1, justifyContent: "center", alignItems: "center", width: "100%" };
|
|
obj2.resolvingContainer = { padding: 64 };
|
|
let closure_11 = createStyles.createStyles(obj2);
|
|
const constants = { LOADING: 0, [0]: "LOADING", DETAILS: 1, [1]: "DETAILS", ERROR: 2, [2]: "ERROR" };
|
|
const size = fn(2);
|
|
let result = size.fileFinishedImporting("modules/accept_invite/native/AcceptInvite.tsx");
|
|
|
|
export default function AcceptInvite(invite) {
|
|
invite = invite.invite;
|
|
const merged = Object.assign(invite, Object.assign({ invite: 0 }));
|
|
const tmp2 = closure_11();
|
|
({ height, width } = useWindowDimensionsDefault());
|
|
let obj = invite;
|
|
if (invite == null) {
|
|
obj = {};
|
|
}
|
|
const guild = obj.guild;
|
|
let splash;
|
|
if (guild != null) {
|
|
splash = guild.splash;
|
|
}
|
|
if (null == splash) {
|
|
let guildSplashSource = tmp3(12877);
|
|
} else {
|
|
const obj2 = { id: null, splash: null, size: null };
|
|
({ id: obj3.id, splash: obj3.splash } = guild);
|
|
const tmp3Result2 = tmp3(1397);
|
|
obj2.size = width * ImageLoaderUtils.getDevicePixelRatio();
|
|
guildSplashSource = tmp3Result2.getGuildSplashSource(obj2);
|
|
}
|
|
const obj5 = { style: null, children: null };
|
|
const items = [tmp2.parentContainer, { height, width }];
|
|
obj5.style = items;
|
|
const items1 = [React7(timestampProducer, { source: guildSplashSource, imageStyle: tmp2.imageStyle, style: { height, width } }), ];
|
|
const obj7 = { style: tmp2.cardContainer, children: null };
|
|
const obj8 = { style: tmp2.cardContent, children: null };
|
|
const merged1 = Object.assign(merged);
|
|
obj8.children = React7(AcceptInviteCardComponent, { invite });
|
|
obj7.children = React7(React5, obj8);
|
|
items1[1] = React7(Card.Card, obj7);
|
|
obj5.children = items1;
|
|
return closure_1_10(React5, obj5);
|
|
};
|