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

104 lines
7.0 KiB
TypeScript

/* Metro module 15346; source: modules/launchpad/native/shared/DMChannel.tsx; dependencies: [31, 4865, 33, 4601, 12129, 4501, 697, 15332, 14436, 13775, 21, 4584, 15333, 5278, 15345, 15336, 10975, 3834, 4805, 2] */
import Native from '../../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
import UseMessagePreviews from '../../../main_tabs_v2/useMessagePreviews.tsx'; /* Metro dependency 13775 */
import GetLayoutStyles from './getLayoutStyles.tsx'; /* Metro dependency 15332 */
import RenderChannelPressableWrapper from './renderChannelPressableWrapper.tsx'; /* Metro dependency 15333 */
import UnreadBadge from './UnreadBadge.tsx'; /* Metro dependency 15336 */
import RenderChannelItem from './renderChannelItem.tsx'; /* Metro dependency 15345 */
import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
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 CreateStylesModule from '../../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
import * as UseFontScaleModule from '../../../screen/native/useFontScale.tsx'; /* Metro dependency 4584 */
import * as ReadStateConstantsModule from '../../../read_states/ReadStateConstants.tsx'; /* Metro dependency 4865 */
import * as PressablesModule from '../../../../design/void/Pressables/native/Pressables.tsx'; /* Metro dependency 5278 */
import * as UseChannelUnreadBadgeStateModule from './useChannelUnreadBadgeState.tsx'; /* Metro dependency 14436 */
function _fun117297(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#117297, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15543:6, offset: 0x024ade6c, size: 258 bytes, params: 8, frame: 22
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = ReactModule;
const createStyles = CreateStylesModule.createStyles;
const INTERACTIVE_BACKGROUND_ACTIVE = (Native).colors.INTERACTIVE_BACKGROUND_ACTIVE;
const env0_6 = Reflect.apply(createStyles, CreateStylesModule, [{pressable: {flex: 1},
pressableUnderlayColor: {backgroundColor: INTERACTIVE_BACKGROUND_ACTIVE}}]);
value = value.memo(DMChannel);
(FileImportTrackerModule).fileFinishedImporting('modules/launchpad/native/shared/DMChannel.tsx');
exports.default = value;
function usePrivateChannelPressEvents(a0, a1) { // fn#117298, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15543:144, offset: 0x024adf6e, size: 106 bytes, params: 3, frame: 18
const env0_0 = a0;
const env0_1 = a1;
const object = {};
object.onPress = env0_3.useCallback(_fun117299, [a0.id, a1]);
object.onLongPress = env0_3.useCallback(_fun117300, [a0.id]);
return object;
function _fun117299() { // fn#117299, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15543:217, offset: 0x024adfd8, size: 62 bytes, params: 1, frame: 15
let value = environment.__proto__;
value = require(4601) /* metro dependency 4601: transitionToChannel */;
value.transitionToChannel(env0_0.id, {navigationReplace: require});
}
function _fun117300() { // fn#117300, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15543:317, offset: 0x024ae016, size: 50 bytes, params: 1, frame: 11
let value = environment.__proto__;
value = require(12129) /* metro dependency 12129: openChannelLongPressActionSheet */;
return value.openChannelLongPressActionSheet(env0_0.id);
}
}
function DMChannel({channel, muted, navigationReplace}) { // fn#117301, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15543:526, offset: 0x024ae048, size: 603 bytes, params: 2, frame: 31
var object3;
var r10;
var defaultImport2;
muted = !(muted === undefined) && muted;
navigationReplace = !(navigationReplace === undefined) && navigationReplace;
const styles = useStyles();
const value5 = (GetLayoutStyles)();
const {unread,
mentionCount} = (UseChannelUnreadBadgeStateModule).useBaseChannelUnreadBadgeState(channel,
muted);
const value7 = (UseMessagePreviews)(channel, {unread: unread});
if (value7 != null) {
defaultImport2 = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
r10 = defaultImport2.extractTimestamp(value7.id);
} else {
r10 = undefined;
}
const value9 = 'text-muted';
const r18 = unread ? muted ? value9 : 'text-default' : value9;
const value11 = (UseFontScaleModule).useFontScale();
const defaultImport3 = RenderChannelPressableWrapper;
const PressableHighlight = (PressablesModule).PressableHighlight;
object3 = {};
const borderRadius = value5.container.borderRadius;
object3.style = [styles.pressable, {borderRadius: borderRadius}];
object3.underlayColor = styles.pressableUnderlayColor.backgroundColor;
copyDataProperties(object3, usePrivateChannelPressEvents(channel, navigationReplace), borderRadius);
const defaultImport4 = RenderChannelItem;
const object = {channel: channel, unread: unread};
let ALL_MESSAGES = UnreadSetting.ALL_MESSAGES;
object.resolvedUnreadSetting = ALL_MESSAGES;
object.muted = muted;
object.mentionCount = mentionCount;
ALL_MESSAGES = UnreadSetting.ALL_MESSAGES;
object.unreadBadge = (
<UnreadBadge
unread={unread}
resolvedUnreadSetting={ALL_MESSAGES}
muted={muted}
/>
);
object.subtitle = value7 != null && ((ChannelRowPreview) => <ChannelRowPreview channel={channel} message={value7} color={r18} muted={muted} layout={(require(3834) /* metro dependency 3834: ChannelListLayoutTypes */).ChannelListLayoutTypes.COMPACT} />)((require(10975) /* metro dependency 10975: ChannelRowPreview */).ChannelRowPreview);
object.latestMessageTimestamp = r10;
object.channelName = (importDefault(4805) /* metro dependency 4805: useChannelName */)(channel);
object.fontScale = value11;
return defaultImport3(<PressableHighlight {...object3}>{defaultImport4(object)}</PressableHighlight>);
}
}
global.__d(_fun117297, 15346, [31, 4865, 33, 4601, 12129, 4501, 697, 15332, 14436, 13775, 21, 4584, 15333, 5278,
15345, 15336, 10975, 3834, 4805,
2]) /* metro module 15346, dependencies: [31, 4865, 33, 4601, 12129, 4501, 697, 15332, 14436, 13775, 21, 4584, 15333, 5278, 15345, 15336, 10975, 3834, 4805, 2] */;