562 lines
33 KiB
TypeScript
562 lines
33 KiB
TypeScript
/* Metro module 12067; source: modules/navbars/native/components/ChannelNavbar.tsx; dependencies: [31, 27, 4257, 1383, 1379, 1867, 4396, 3793, 1878, 661, 1386, 1376, 33, 4501, 6597, 697, 566, 1244, 6647, 4805, 8829, 12068, 12069, 1305, 9713, 12070, 5475, 9711, 8581, 5278, 4573, 3995, 8419, 8792, 3968, 1365, 10357, 12071, 2] */
|
|
import ChannelStore from '../../../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
|
|
import GuildStore from '../../../../stores/GuildStore.tsx'; /* Metro dependency 1867 */
|
|
import UserStore from '../../../../stores/UserStore.tsx'; /* Metro dependency 1878 */
|
|
import RelationshipStore from '../../../../stores/RelationshipStore.tsx'; /* Metro dependency 3793 */
|
|
import GatewayConnectionStore from '../../../gateway/GatewayConnectionStore.tsx'; /* Metro dependency 4257 */
|
|
import PresenceStore from '../../../../stores/PresenceStore.tsx'; /* Metro dependency 4396 */
|
|
import TextStyles from '../../../rebrand/native/TextStyles.tsx'; /* Metro dependency 6597 */
|
|
import UseIsViewingPremiumMemberships from '../../../guild_role_subscriptions/useIsViewingPremiumMemberships.tsx'; /* Metro dependency 12069 */
|
|
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 IndexNativeModule from '../../../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as NativeModule from '../../../../design/void/native.tsx'; /* Metro dependency 1305 */
|
|
import * as Dismissible_contentModule from '../../../../external/discord_common/js/packages/protos/discord_protos/discord_users/v1/dismissible_content.tsx'; /* Metro dependency 1365 */
|
|
import * as DismissibleContentConstantsModule from '../../../dismissible_content/DismissibleContentConstants.tsx'; /* Metro dependency 1376 */
|
|
import * as ChannelRecordModule from '../../../../records/ChannelRecord.tsx'; /* Metro dependency 1383 */
|
|
import * as ChannelConstantsModule from '../../../channel/ChannelConstants.tsx'; /* Metro dependency 1386 */
|
|
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 UseChannelNameModule from '../../../channel/useChannelName.tsx'; /* Metro dependency 4805 */
|
|
import * as NavigationPathUtilsModule from '../NavigationPathUtils.tsx'; /* Metro dependency 12068 */
|
|
|
|
function _fun92711(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#92711, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12253:6, offset: 0x02095cb4, size: 819 bytes, params: 8, frame: 28
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactModule;
|
|
const Fonts = ConstantsModule.Fonts;
|
|
const createStyles = CreateStylesModule.createStyles;
|
|
object = {navbarTitleContainer: {'height': '100%', 'flex': 1, 'flexDirection': 'row', 'alignItems': 'center'}};
|
|
const object2 = {};
|
|
const DISPLAY_SEMIBOLD = Fonts.DISPLAY_SEMIBOLD;
|
|
const MOBILE_TEXT_HEADING_PRIMARY = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_TEXT_HEADING_PRIMARY;
|
|
copyDataProperties(object2, TextStyles(DISPLAY_SEMIBOLD, MOBILE_TEXT_HEADING_PRIMARY, 18), undefined);
|
|
object2['flexShrink'] = 1;
|
|
object.navbarTitlePrimaryText = object2;
|
|
let TEXT_MUTED = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_MUTED;
|
|
object.navbarTitleSecondaryText = {'fontSize': 12, 'lineHeight': 16, 'color': null, 'marginTop': -4,
|
|
color: TEXT_MUTED};
|
|
object.channelIcon = {'height': 18, 'width': 18, 'marginRight': 8};
|
|
const CHANNEL_ICON = (importDefault(697) /* metro dependency 697: native */).colors.CHANNEL_ICON;
|
|
object.channelIconColor = {color: CHANNEL_ICON};
|
|
TEXT_MUTED = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_MUTED;
|
|
object.homeIcon = {'height': 20, 'width': 20, 'tintColor': null, 'marginTop': 0, 'marginRight': 8,
|
|
tintColor: TEXT_MUTED};
|
|
object.premiumIcon = {marginRight: 4};
|
|
object.status = {'marginLeft': 1, 'marginTop': 4};
|
|
object.channelTextContainer = {'flex': 1, 'flexGrow': 1};
|
|
object.channelNameContainer = {flexGrow: 1};
|
|
object.channelName = {textAlign: 'left'};
|
|
object.flexRow = {'flexDirection': 'row', 'alignItems': 'center'};
|
|
const env0_18 = Reflect.apply(createStyles, CreateStylesModule, [object]);
|
|
value = value.memo(_fun92712);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/navbars/native/components/ChannelNavbar.tsx');
|
|
exports.ChannelTitleWithoutRoute = ChannelTitleWithoutRoute;
|
|
exports.ChannelTitle = value;
|
|
exports.ChannelButtons = ChannelButtons;
|
|
function _fun92712({onPressTitle, channelId, guildId, threadDraft, style}) { // fn#92712, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12253:1130, offset: 0x02095fe7, size: 2054 bytes, params: 2, frame: 33
|
|
var r14;
|
|
var moduleValue6;
|
|
var moduleValue7;
|
|
var channelName;
|
|
var channelIconWithGuild;
|
|
var isThread2;
|
|
var formatToPlainString;
|
|
var recipientId;
|
|
var moduleValue9;
|
|
const styles = useStyles();
|
|
let useStateFromStores = FluxModule.useStateFromStores;
|
|
const value3 = Reflect.apply(useStateFromStores, FluxModule, [[GatewayConnectionStore], function() {
|
|
return GatewayConnectionStore.isConnected();
|
|
}]);
|
|
useStateFromStores = FluxModule.useStateFromStores;
|
|
const channelStoreBinding = ChannelStore;
|
|
const value4 = Reflect.apply(useStateFromStores, FluxModule, [[channelStoreBinding], _fun92714]);
|
|
const guild = FluxModule.useStateFromStores([GuildStore], _fun92715);
|
|
const value5 = FluxModule.useStateFromStores([channelStoreBinding], _fun92716, [value4, threadDraft]);
|
|
const value6 = (NavigationPathUtilsModule).useSelectedSpecialNavigationPath();
|
|
const value7 = (UseIsViewingPremiumMemberships)();
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const string = intl.string;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
const r13 = value3 ? Reflect.apply(string, intl, [t.ai6Lbr]) : Reflect.apply(string, intl, [t.ZTNur7]);
|
|
const SpecialNavigationPath = (NavigationPathUtilsModule).SpecialNavigationPath;
|
|
const FRIENDS = SpecialNavigationPath.FRIENDS;
|
|
if (value6 === FRIENDS) {
|
|
return (
|
|
<ChannelTitleWrapper style={style}>
|
|
<ChannelTitleContent title={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.TdEu5X)} />
|
|
</ChannelTitleWrapper>
|
|
);
|
|
}
|
|
const GUILD_HOME = StaticChannelRoute.GUILD_HOME;
|
|
if (channelId === GUILD_HOME) {
|
|
return (
|
|
<ChannelTitleWrapper onPressTitle={onPressTitle} style={style}>
|
|
<ChannelTitleContent
|
|
title={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.Ym2Ri6)}
|
|
icon={((Icon) => <Icon size={(require(1305) /* metro dependency 1305: native */).Icon.Sizes.CUSTOM} source={importDefault(9713) /* metro dependency 9713 */} style={styles.homeIcon} />)((require(1305) /* metro dependency 1305: native */).Icon)}
|
|
/>
|
|
</ChannelTitleWrapper>
|
|
);
|
|
}
|
|
const MEMBER_SAFETY = StaticChannelRoute.MEMBER_SAFETY;
|
|
if (channelId === MEMBER_SAFETY) {
|
|
return (
|
|
<ChannelTitleWrapper onPressTitle={onPressTitle} style={style}>
|
|
<ChannelTitleContent
|
|
title={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['9Oq93m'])}
|
|
icon={((Icon) => <Icon size={(require(1305) /* metro dependency 1305: native */).Icon.Sizes.CUSTOM} source={importDefault(12070) /* metro dependency 12070 */} style={styles.homeIcon} />)((require(1305) /* metro dependency 1305: native */).Icon)}
|
|
/>
|
|
</ChannelTitleWrapper>
|
|
);
|
|
}
|
|
if (value7) {
|
|
return (
|
|
<ChannelTitleWrapper style={style}>
|
|
<ChannelTitleContent
|
|
title={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['KzCF/6'])}
|
|
icon={((Component) => <Component source={importDefault(9711) /* metro dependency 9711 */} style={styles.premiumIcon} />)(importDefault(5475) /* metro dependency 5475: FastImage */)}
|
|
/>
|
|
</ChannelTitleWrapper>
|
|
);
|
|
}
|
|
if (threadDraft == null) {
|
|
moduleValue6 = require(8581) /* metro dependency 8581: AgeGateUtils */;
|
|
if (moduleValue6.shouldNSFWGateGuild(guildId)) {
|
|
return (
|
|
<ChannelTitleWrapper style={style}>
|
|
<ChannelTitleContent title={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.HbPHt1)} />
|
|
</ChannelTitleWrapper>
|
|
);
|
|
}
|
|
if (value4 == null) {
|
|
return (
|
|
<ChannelTitleWrapper style={style}>
|
|
<ChannelTitleContent title={r13} />
|
|
</ChannelTitleWrapper>
|
|
);
|
|
}
|
|
moduleValue7 = require(4805) /* metro dependency 4805: useChannelName */;
|
|
channelName = moduleValue7.computeChannelName(value4, UserStore, RelationshipStore);
|
|
channelIconWithGuild = (require(6647) /* metro dependency 6647: ChannelUtils */).getChannelIconWithGuild(value4,
|
|
guild);
|
|
if (value4.isDM()) {
|
|
recipientId = value4.getRecipientId();
|
|
return (
|
|
<ChannelTitleWrapper onPressTitle={onPressTitle} style={style}>
|
|
<ChannelTitleContent
|
|
title={<DMChannelName userId={recipientId} style={styles.navbarTitlePrimaryText} />}
|
|
icon={channelIconWithGuild}
|
|
titleSuffix={value4.isSystemDM()
|
|
? null
|
|
: (
|
|
<ConnectedStatus userId={recipientId} style={styles.status} />
|
|
)}
|
|
subTitle={((Component) => <Component userId={recipientId} guildId={value4?.guild_id} />)(importDefault(8829) /* metro dependency 8829: ActivityStatus */)}
|
|
/>
|
|
</ChannelTitleWrapper>
|
|
);
|
|
}
|
|
isThread2 = value4.isThread();
|
|
formatToPlainString = intl.formatToPlainString;
|
|
if (isThread2) {
|
|
return (
|
|
<ChannelTitleWrapper onPressTitle={onPressTitle} style={style}>
|
|
<ChannelTitleContent
|
|
title={channelName}
|
|
accessibleTitle={Reflect.apply(formatToPlainString, intl, [t['OkzL+Q'],
|
|
{channelName: channelName}])}
|
|
icon={channelIconWithGuild}
|
|
subTitle={value5 != null && <ParentChannelSubTitle_92720 parentChannel={value5} />}
|
|
/>
|
|
</ChannelTitleWrapper>
|
|
);
|
|
}
|
|
return (
|
|
<ChannelTitleWrapper onPressTitle={onPressTitle} style={style}>
|
|
<ChannelTitleContent
|
|
title={channelName}
|
|
accessibleTitle={Reflect.apply(formatToPlainString, intl, [t.UbNmGc, {channelName: channelName}])}
|
|
icon={channelIconWithGuild}
|
|
/>
|
|
</ChannelTitleWrapper>
|
|
);
|
|
}
|
|
if (value4 == null) {
|
|
r14 = threadDraft.name == null ? intl.string((require(1244) /* metro dependency 1244: indexNative */).t['4WNcpu']) : threadDraft.name.length > 0 ? threadDraft.name : intl.string((require(1244) /* metro dependency 1244: indexNative */).t['4WNcpu']);
|
|
moduleValue9 = require(6647) /* metro dependency 6647: ChannelUtils */;
|
|
return (
|
|
<ChannelTitleWrapper style={style}>
|
|
<ChannelTitleContent
|
|
title={r14}
|
|
accessibleTitle={intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t['OkzL+Q'],
|
|
|
|
{channelName: r14})}
|
|
icon={moduleValue9.getThreadChannelIcon(threadDraft.isPrivate ? ChannelTypes.PRIVATE_THREAD : ChannelTypes.PUBLIC_THREAD)}
|
|
subTitle={value5 != null && <ParentChannelSubTitle_92720 parentChannel={value5} />}
|
|
/>
|
|
</ChannelTitleWrapper>
|
|
);
|
|
}
|
|
if (value4.isForumLikeChannel()) {
|
|
moduleValue6 = require(8581) /* metro dependency 8581: AgeGateUtils */;
|
|
if (moduleValue6.shouldNSFWGateGuild(guildId)) {
|
|
return (
|
|
<ChannelTitleWrapper style={style}>
|
|
<ChannelTitleContent title={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.HbPHt1)} />
|
|
</ChannelTitleWrapper>
|
|
);
|
|
}
|
|
if (value4 == null) {
|
|
return (
|
|
<ChannelTitleWrapper style={style}>
|
|
<ChannelTitleContent title={r13} />
|
|
</ChannelTitleWrapper>
|
|
);
|
|
}
|
|
moduleValue7 = require(4805) /* metro dependency 4805: useChannelName */;
|
|
channelName = moduleValue7.computeChannelName(value4, UserStore, RelationshipStore);
|
|
channelIconWithGuild = (require(6647) /* metro dependency 6647: ChannelUtils */).getChannelIconWithGuild(value4,
|
|
guild);
|
|
if (value4.isDM()) {
|
|
recipientId = value4.getRecipientId();
|
|
return (
|
|
<ChannelTitleWrapper onPressTitle={onPressTitle} style={style}>
|
|
<ChannelTitleContent
|
|
title={<DMChannelName userId={recipientId} style={styles.navbarTitlePrimaryText} />}
|
|
icon={channelIconWithGuild}
|
|
titleSuffix={value4.isSystemDM()
|
|
? null
|
|
: (
|
|
<ConnectedStatus userId={recipientId} style={styles.status} />
|
|
)}
|
|
subTitle={((Component) => <Component userId={recipientId} guildId={value4?.guild_id} />)(importDefault(8829) /* metro dependency 8829: ActivityStatus */)}
|
|
/>
|
|
</ChannelTitleWrapper>
|
|
);
|
|
}
|
|
isThread2 = value4.isThread();
|
|
formatToPlainString = intl.formatToPlainString;
|
|
if (isThread2) {
|
|
return (
|
|
<ChannelTitleWrapper onPressTitle={onPressTitle} style={style}>
|
|
<ChannelTitleContent
|
|
title={channelName}
|
|
accessibleTitle={Reflect.apply(formatToPlainString, intl, [t['OkzL+Q'],
|
|
{channelName: channelName}])}
|
|
icon={channelIconWithGuild}
|
|
subTitle={value5 != null && <ParentChannelSubTitle_92720 parentChannel={value5} />}
|
|
/>
|
|
</ChannelTitleWrapper>
|
|
);
|
|
}
|
|
return (
|
|
<ChannelTitleWrapper onPressTitle={onPressTitle} style={style}>
|
|
<ChannelTitleContent
|
|
title={channelName}
|
|
accessibleTitle={Reflect.apply(formatToPlainString, intl, [t.UbNmGc, {channelName: channelName}])}
|
|
icon={channelIconWithGuild}
|
|
/>
|
|
</ChannelTitleWrapper>
|
|
);
|
|
}
|
|
r14 = threadDraft.name == null ? intl.string((require(1244) /* metro dependency 1244: indexNative */).t['4WNcpu']) : threadDraft.name.length > 0 ? threadDraft.name : intl.string((require(1244) /* metro dependency 1244: indexNative */).t['4WNcpu']);
|
|
moduleValue9 = require(6647) /* metro dependency 6647: ChannelUtils */;
|
|
const getThreadChannelIcon = moduleValue9.getThreadChannelIcon;
|
|
return (
|
|
<ChannelTitleWrapper style={style}>
|
|
<ChannelTitleContent
|
|
title={r14}
|
|
accessibleTitle={intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t['OkzL+Q'],
|
|
{channelName: r14})}
|
|
icon={Reflect.apply(getThreadChannelIcon, moduleValue9,
|
|
[threadDraft.isPrivate ? ChannelTypes.PRIVATE_THREAD : ChannelTypes.PUBLIC_THREAD])}
|
|
subTitle={value5 != null && <ParentChannelSubTitle_92720 parentChannel={value5} />}
|
|
/>
|
|
</ChannelTitleWrapper>
|
|
);
|
|
function _fun92714() { // fn#92714, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12253:1303, offset: 0x020967ed, size: 66 bytes, params: 1, frame: 14
|
|
const channelIdBinding = channelId;
|
|
const GUILD_HOME = StaticChannelRoute.GUILD_HOME;
|
|
return channelIdBinding === GUILD_HOME || channelId === StaticChannelRoute.MEMBER_SAFETY ? null : ChannelStore.getChannel(channelId);
|
|
}
|
|
|
|
function _fun92715() { // fn#92715, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12253:1403, offset: 0x0209682f, size: 52 bytes, params: 1, frame: 13
|
|
const value = environment.__proto__;
|
|
return GuildStore.getGuild(env0_2?.getGuildId());
|
|
}
|
|
|
|
function _fun92716() { // fn#92716, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12253:1486, offset: 0x02096863, size: 145 bytes, params: 1, frame: 15
|
|
const threadDraftBinding = threadDraft;
|
|
const value2 = null;
|
|
return value2 == threadDraftBinding ? value2 != env0_2 && value2 != env0_2.parent_id && THREAD_CHANNEL_TYPES.has(env0_2.type) ? ChannelStore.getChannel(env0_2.parent_id) : value2 : value2 != threadDraft.parentChannelId ? ChannelStore.getChannel(threadDraft.parentChannelId) : value2 != env0_2 && value2 != env0_2.parent_id && THREAD_CHANNEL_TYPES.has(env0_2.type) ? ChannelStore.getChannel(env0_2.parent_id) : value2;
|
|
}
|
|
|
|
}
|
|
|
|
function ChannelTitleWrapper({children, onPressTitle, style}) { // fn#92717, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12253:4288, offset: 0x020968f4, size: 174 bytes, params: 2, frame: 20
|
|
const styles = useStyles();
|
|
if (onPressTitle == null) {
|
|
return (
|
|
<View style={[styles.navbarTitleContainer, style]}>
|
|
{children}
|
|
</View>
|
|
);
|
|
} else {
|
|
const PressableOpacity = (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity;
|
|
return (
|
|
<PressableOpacity
|
|
style={[styles.navbarTitleContainer, style]}
|
|
accessibilityRole="header"
|
|
onPress={onPressTitle}
|
|
onAccessibilityTap={function() {
|
|
return null;
|
|
}}
|
|
>
|
|
{children}
|
|
</PressableOpacity>
|
|
);
|
|
}
|
|
}
|
|
|
|
function ChannelTitleContent({title, icon, titleSuffix, subTitle, accessibleTitle}) { // fn#92719, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12253:4565, offset: 0x020969a2, size: 403 bytes, params: 2, frame: 25
|
|
const styles = useStyles();
|
|
const r5 = (
|
|
icon != null
|
|
? (
|
|
env0_3.isValidElement(icon)
|
|
? icon
|
|
: ((Icon) => <Icon size={(require(1305) /* metro dependency 1305: native */).Icon.Sizes.CUSTOM} source={icon} style={styles.channelIcon} color={styles.channelIconColor.color} />)((require(1305) /* metro dependency 1305: native */).Icon)
|
|
)
|
|
: null
|
|
);
|
|
const binding = env0_3;
|
|
return (
|
|
<View style={styles.flexRow}>
|
|
{r5}
|
|
<View style={styles.channelTextContainer}>
|
|
<View style={styles.flexRow}>
|
|
{
|
|
binding.isValidElement(title)
|
|
? title
|
|
: (
|
|
<View style={styles.channelNameContainer}>
|
|
{((Text) => <Text style={styles.channelName} lineClamp={1} variant="heading-md/bold" color="mobile-text-heading-primary" accessibilityLabel={accessibleTitle} maxFontSizeMultiplier={1} accessibilityRole="header">{title}</Text>)((require(4573) /* metro dependency 4573: Text */).Text)}
|
|
</View>
|
|
)
|
|
}
|
|
{titleSuffix}
|
|
</View>
|
|
{subTitle}
|
|
</View>
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function ParentChannelSubTitle_92720({parentChannel}) { // fn#92720, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12253:5214, offset: 0x02096b35, size: 216 bytes, params: 2, frame: 27
|
|
const styles = useStyles();
|
|
const Text = (TextModule).Text;
|
|
const intl = (IndexNativeModule).intl;
|
|
const formatToPlainString = intl.formatToPlainString;
|
|
const BjYvHO = (IndexNativeModule).t.BjYvHO;
|
|
const computeChannelName = UseChannelNameModule.computeChannelName;
|
|
const userStoreBinding = UserStore;
|
|
const relationshipStoreBinding = RelationshipStore;
|
|
return (
|
|
<Text
|
|
lineClamp={1}
|
|
style={styles.navbarTitleSecondaryText}
|
|
accessibilityLabel={Reflect.apply(formatToPlainString, intl, [BjYvHO,
|
|
{channelName: Reflect.apply(computeChannelName, UseChannelNameModule, [parentChannel, userStoreBinding,
|
|
relationshipStoreBinding])}])}
|
|
maxFontSizeMultiplier={1}
|
|
variant="text-xs/medium"
|
|
color="text-muted"
|
|
>
|
|
{UseChannelNameModule.computeChannelName(parentChannel, userStoreBinding, relationshipStoreBinding, true)}
|
|
</Text>
|
|
);
|
|
}
|
|
|
|
function DMChannelName({userId, style}) { // fn#92721, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12253:5568, offset: 0x02096c0d, size: 206 bytes, params: 2, frame: 21
|
|
const value2 = (FluxModule).useStateFromStores([UserStore, RelationshipStore],
|
|
_fun92722, [userId]);
|
|
const LegacyText = (NativeModule).LegacyText;
|
|
const intl = (IndexNativeModule).intl;
|
|
return (
|
|
<LegacyText
|
|
numberOfLines={1}
|
|
style={style}
|
|
accessibilityLabel={intl.formatToPlainString((IndexNativeModule).t.fYqXVY,
|
|
{channelName: value2})}
|
|
maxFontSizeMultiplier={1}
|
|
accessibilityRole="header"
|
|
>
|
|
{value2}
|
|
</LegacyText>
|
|
);
|
|
function _fun92722() { // fn#92722, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12253:5632, offset: 0x02096cdb, size: 95 bytes, params: 1, frame: 14
|
|
var r1;
|
|
let value = environment.__proto__;
|
|
const relationshipStoreBinding = RelationshipStore;
|
|
const getNickname = relationshipStoreBinding.getNickname;
|
|
const userIdBinding = userId;
|
|
const value3 = Reflect.apply(getNickname, relationshipStoreBinding, [userIdBinding]);
|
|
if (value3 != null) {
|
|
r1 = value3;
|
|
} else {
|
|
value = importDefault(3995) /* metro dependency 3995: UserUtils */;
|
|
value = value.getName(UserStore.getUser(userIdBinding));
|
|
r1 = value;
|
|
}
|
|
return r1 ?? '';
|
|
}
|
|
|
|
}
|
|
|
|
function ConnectedStatus({style, userId}) { // fn#92723, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12253:5959, offset: 0x02096d3a, size: 178 bytes, params: 2, frame: 21
|
|
const {status, isMobileOnline, isVROnline,
|
|
streaming} = (FluxModule).useStateFromStoresObject([PresenceStore],
|
|
_fun92724);
|
|
const Status = (NativeModule).Status;
|
|
const StatusSizes = (NativeModule).StatusSizes;
|
|
const SMALL = StatusSizes.SMALL;
|
|
return (
|
|
<Status
|
|
isMobileOnline={isMobileOnline}
|
|
isVROnline={isVROnline}
|
|
status={status}
|
|
streaming={streaming}
|
|
size={SMALL}
|
|
style={style}
|
|
/>
|
|
);
|
|
function _fun92724() { // fn#92724, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12253:6027, offset: 0x02096dec, size: 108 bytes, params: 1, frame: 14
|
|
const object = {};
|
|
let value = environment.__proto__;
|
|
const presenceStoreBinding = PresenceStore;
|
|
const getStatus = presenceStoreBinding.getStatus;
|
|
const userIdBinding = userId;
|
|
object.status = Reflect.apply(getStatus, presenceStoreBinding, [userIdBinding]);
|
|
object.isMobileOnline = presenceStoreBinding.isMobileOnline(userIdBinding);
|
|
object.isVROnline = presenceStoreBinding.isVROnline(userIdBinding);
|
|
value = importDefault(8419) /* metro dependency 8419: isStreaming */;
|
|
const getActivities = presenceStoreBinding.getActivities;
|
|
object.streaming = value(Reflect.apply(getActivities, presenceStoreBinding, [userIdBinding]));
|
|
return object;
|
|
}
|
|
|
|
}
|
|
|
|
function ChannelTitleWithoutRoute({onPressTitle, channelId}) { // fn#92725, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12253:6453, offset: 0x02096e58, size: 538 bytes, params: 2, frame: 25
|
|
var r13;
|
|
var moduleValue4;
|
|
var recipientId;
|
|
const styles = useStyles();
|
|
const channel = (require(566) /* metro dependency 566: flux */).useStateFromStores([ChannelStore], function() {
|
|
return ChannelStore.getChannel(channelId);
|
|
});
|
|
const value2 = (require(566) /* metro dependency 566: flux */).useStateFromStores([GatewayConnectionStore],
|
|
function() {
|
|
return GatewayConnectionStore.isConnected();
|
|
});
|
|
const intl = (IndexNativeModule).intl;
|
|
const string = intl.string;
|
|
const t = (IndexNativeModule).t;
|
|
let r12 = value2 ? Reflect.apply(string, intl, [t.ai6Lbr]) : Reflect.apply(string, intl, [t.ZTNur7]);
|
|
const r8 = channel != null ? (require(6647) /* metro dependency 6647: ChannelUtils */).getChannelIcon(channel) : null;
|
|
if (channel != null) {
|
|
moduleValue4 = require(4805) /* metro dependency 4805: useChannelName */;
|
|
r13 = moduleValue4.computeChannelName(channel, UserStore, RelationshipStore);
|
|
} else {
|
|
r13 = null;
|
|
}
|
|
if (channel != null) {
|
|
if (channel.isDM()) {
|
|
recipientId = channel.getRecipientId();
|
|
return (
|
|
<ChannelTitleWrapper onPressTitle={onPressTitle}>
|
|
<ChannelTitleContent
|
|
title={<DMChannelName userId={recipientId} style={styles.navbarTitlePrimaryText} />}
|
|
icon={r8}
|
|
titleSuffix={channel.isSystemDM()
|
|
? null
|
|
: (
|
|
<ConnectedStatus userId={recipientId} style={styles.status} />
|
|
)}
|
|
subTitle={((Component) => <Component userId={recipientId} guildId={channel.guild_id} />)(importDefault(8829) /* metro dependency 8829: ActivityStatus */)}
|
|
/>
|
|
</ChannelTitleWrapper>
|
|
);
|
|
}
|
|
}
|
|
r12 = r13 ?? r12;
|
|
return (
|
|
<ChannelTitleWrapper onPressTitle={onPressTitle}>
|
|
<ChannelTitleContent title={r12} icon={r8} />
|
|
</ChannelTitleWrapper>
|
|
);
|
|
}
|
|
|
|
function ChannelButtons({buttons, style}) { // fn#92728, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12253:7269, offset: 0x02097072, size: 75 bytes, params: 2, frame: 17
|
|
return (
|
|
<View style={style}>
|
|
{buttons?.map(_fun92729)}
|
|
</View>
|
|
);
|
|
function _fun92729({onPress, onLongPress, source, color, style, accessibilityLabel, children, disabled, hasActivitiesPrivateChannelTooltip}, a1) { // fn#92729, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12253:7336, offset: 0x020970bd, size: 288 bytes, params: 3, frame: 29
|
|
var environment;
|
|
const value = environment.__proto__;
|
|
return (
|
|
<View key={a1}>
|
|
{((Component) => <Component accessibilityRole="button" accessibilityLabel={accessibilityLabel} color={color} source={source} onPress={hasActivitiesPrivateChannelTooltip ? function(a0) {
|
|
if (onPress != null) {
|
|
onPress(a0);
|
|
}
|
|
var moduleValue = require(dependencyMap[34]);
|
|
var ACTIVITY_GDM_CALL_TOOLTIP = require(dependencyMap[35]).DismissibleContent.ACTIVITY_GDM_CALL_TOOLTIP;
|
|
moduleValue.UNSAFE_markDismissibleContentAsDismissed(ACTIVITY_GDM_CALL_TOOLTIP,
|
|
{dismissAction: ContentDismissActionType.AUTO});
|
|
} : onPress} onLongPress={onLongPress} disabled={disabled} style={style}>{children}</Component>)(importDefault(8792) /* metro dependency 8792: TouchableHitBox */)}
|
|
{
|
|
hasActivitiesPrivateChannelTooltip
|
|
? ((Component) => <Component contentTypes={[(require(1365) /* metro dependency 1365: dismissible_content */).DismissibleContent.ACTIVITY_GDM_CALL_TOOLTIP]} groupName={DismissibleContentGroupName.CHANNEL_HEADER_CALL_BUTTON_TOOLTIPS}>{children_92731}</Component>)(importDefault(10357) /* metro dependency 10357: SelectedDismissibleContent */)
|
|
: null
|
|
}
|
|
</View>
|
|
);
|
|
function children_92731({visibleContent, markAsDismissed}) { // fn#92731, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12253:7909, offset: 0x02097248, size: 110 bytes, params: 2, frame: 16
|
|
var environment;
|
|
var r0;
|
|
let value = environment.__proto__.__proto__;
|
|
const DismissibleContent = (Dismissible_contentModule).DismissibleContent;
|
|
const ACTIVITY_GDM_CALL_TOOLTIP = DismissibleContent.ACTIVITY_GDM_CALL_TOOLTIP;
|
|
if (visibleContent !== ACTIVITY_GDM_CALL_TOOLTIP) {
|
|
r0 = null;
|
|
} else {
|
|
value = importDefault(12071) /* metro dependency 12071: ActivitiesPrivateChannelCallTooltip */;
|
|
value = ((Component) => <Component onClosePress={function() {
|
|
return markAsDismissed(ContentDismissActionType.UNKNOWN);
|
|
}} />)(value);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun92711, 12067, [31, 27, 4257, 1383, 1379, 1867, 4396, 3793, 1878, 661, 1386, 1376, 33, 4501, 6597,
|
|
697, 566, 1244, 6647, 4805, 8829, 12068, 12069, 1305, 9713, 12070, 5475, 9711, 8581, 5278, 4573, 3995, 8419,
|
|
8792, 3968, 1365, 10357, 12071,
|
|
2]) /* metro module 12067, dependencies: [31, 27, 4257, 1383, 1379, 1867, 4396, 3793, 1878, 661, 1386, 1376, 33, 4501, 6597, 697, 566, 1244, 6647, 4805, 8829, 12068, 12069, 1305, 9713, 12070, 5475, 9711, 8581, 5278, 4573, 3995, 8419, 8792, 3968, 1365, 10357, 12071, 2] */;
|