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

107 lines
7.2 KiB
TypeScript

/* Metro module 10739; source: modules/connectivity/native/components/GlobalStatusContent.tsx; dependencies: [31, 27, 1379, 1867, 4294, 4296, 10735, 661, 33, 4501, 697, 9325, 566, 10659, 10733, 4002, 4048, 8750, 4007, 7714, 477, 1585, 7725, 10740, 2] */
import Native from '../../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
import ChannelStore from '../../../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
import UseSafeAreaInsetsNative from '../../../safe_area/useSafeAreaInsets.native.tsx'; /* Metro dependency 1585 */
import GuildStore from '../../../../stores/GuildStore.tsx'; /* Metro dependency 1867 */
import UseTheme from '../../../../hooks/useTheme.tsx'; /* Metro dependency 4048 */
import RTCConnectionStore from '../../../../stores/RTCConnectionStore.tsx'; /* Metro dependency 4294 */
import SessionsStore from '../../../../stores/SessionsStore.tsx'; /* Metro dependency 4296 */
import UseVoiceStateForRemoteSession from '../../../game_console/hooks/useVoiceStateForRemoteSession.tsx'; /* Metro dependency 9325 */
import UseIsInvitedToSpeak from '../../../stage_channels/useIsInvitedToSpeak.tsx'; /* Metro dependency 10733 */
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 FluxModule from '../../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
import * as ConstantsModule from '../../../../Constants.tsx'; /* Metro dependency 661 */
import * as SharedModule from '../../../../design/shared.tsx'; /* Metro dependency 4002 */
import * as UseIsScreenLandscapeNativeModule from '../../../screen/useIsScreenLandscape.native.tsx'; /* Metro dependency 8750 */
import * as ConnectivityConstantsModule from '../ConnectivityConstants.tsx'; /* Metro dependency 10735 */
function _fun82495(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#82495, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10925:6, offset: 0x01ef88c7, size: 389 bytes, params: 8, frame: 23
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
ReactModule;
const RTC_PANEL_HEIGHT = (ConnectivityConstantsModule).RTC_PANEL_HEIGHT;
let value = JsxRuntimeModule;
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_LOWEST = (Native).colors.BACKGROUND_BASE_LOWEST;
object.bgNeutral = {backgroundColor: BACKGROUND_BASE_LOWEST};
const GREEN_360 = (Native).unsafe_rawColors.GREEN_360;
object.bg = {backgroundColor: GREEN_360};
object.container = {'paddingHorizontal': 16, 'minHeight': null, 'alignItems': 'center', 'justifyContent': 'center',
minHeight: RTC_PANEL_HEIGHT};
const env0_11 = Reflect.apply(createStyles, value, [object]);
(FileImportTrackerModule).fileFinishedImporting('modules/connectivity/native/components/GlobalStatusContent.tsx');
exports.default = _default_82496;
function _default_82496() { // fn#82496, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10925:491, offset: 0x01ef8a4c, size: 633 bytes, params: 1, frame: 29
var r8;
var r5;
var moduleValue4;
var value;
const value2 = undefined;
const styles = useStyles();
const {guild, channel, rtcConnectionState,
remotePlatform} = (FluxModule).useStateFromStoresObject([RTCConnectionStore,
GuildStore, ChannelStore, SessionsStore], _fun82497,
[(UseVoiceStateForRemoteSession)()]);
const value5 = null;
const r7 = value5 == channel ? value2 : channel.isGuildStageVoice();
const value6 = (importDefault(10659) /* metro dependency 10659: useCanSpeakInChannel */)(value5 == channel ? value2 : channel.id);
const value7 = (UseIsInvitedToSpeak)();
const value8 = value5 != channel;
const isThemeDark2 = (SharedModule).isThemeDark((UseTheme)());
const r4 = r7 ? value6 || value7 : value8;
const value9 = (UseIsScreenLandscapeNativeModule).useIsScreenLandscape();
if (value9) {
moduleValue4 = require(4007) /* metro dependency 4007: NavigationRouteUtilsNative */;
r8 = moduleValue4.isModalOpen(importDefault(7714) /* metro dependency 7714: ChannelCallModal */);
} else {
r8 = value9;
}
r8 = r8 && (require(477) /* metro dependency 477: PlatformUtils */).isAndroid();
const top = (UseSafeAreaInsetsNative)().top;
const items2 = [r4 ? styles.bg : styles.bgNeutral];
items2[1] = styles.container;
items2[2] = {paddingTop: r8 ? 0 : top};
r8 = r8 && ((Component) => <Component hidden />)(importDefault(7725) /* metro dependency 7725: StatusBarAndroid */);
if (r7) {
value = importDefault(10740) /* metro dependency 10740: GlobalStageChannelStatus */;
value = ((Component) => <Component channel={channel} guild={guild} hasRTCConnectivity={value8} isDarkTheme={isThemeDark2} rtcConnectionState={rtcConnectionState} remotePlatform={remotePlatform} />)(value);
r5 = value;
} else {
r5 = value5;
}
return (
<View style={items2}>
{r8}
{r5}
</View>
);
function _fun82497() { // fn#82497, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10925:566, offset: 0x01ef8cc5, size: 252 bytes, params: 1, frame: 19
const value = environment.__proto__;
const channelStoreBinding = ChannelStore;
const value3 = undefined;
const channel = channelStoreBinding.getChannel((env0_0 == null ? value3 : env0_0.channelId) ?? RTCConnectionStore.getChannelId());
const guild = GuildStore.getGuild(env0_0 != null ? channel == null ? value3 : channel.getGuildId() : RTCConnectionStore.getGuildId());
const sessionById = SessionsStore.getSessionById((env0_0 == null ? value3 : env0_0.sessionId) ?? '');
const os = sessionById == null ? value3 : sessionById.clientInfo.os;
const object = {guild: guild, channel: channel};
object.rtcConnectionState = env0_0 != null ? RTCConnectionStates.RTC_CONNECTED : RTCConnectionStore.getState();
object.remotePlatform = os;
return object;
}
}
}
global.__d(_fun82495, 10739, [31, 27, 1379, 1867, 4294, 4296, 10735, 661, 33, 4501, 697, 9325, 566, 10659, 10733,
4002, 4048, 8750, 4007, 7714, 477, 1585, 7725, 10740,
2]) /* metro module 10739, dependencies: [31, 27, 1379, 1867, 4294, 4296, 10735, 661, 33, 4501, 697, 9325, 566, 10659, 10733, 4002, 4048, 8750, 4007, 7714, 477, 1585, 7725, 10740, 2] */;