Moves message details into React pane land

This commit is contained in:
Josh Perez 2022-12-21 15:44:23 -05:00 committed by GitHub
parent 3def746014
commit a80c6d89a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 501 additions and 558 deletions

View file

@ -3,8 +3,8 @@
import React from 'react';
import { useSelector } from 'react-redux';
import type { PanelRenderType } from '../../types/Panels';
import type { StateType } from '../reducer';
import type { ReactPanelRenderType } from '../../types/Panels';
import * as log from '../../logging/log';
import { ContactDetail } from '../../components/conversation/ContactDetail';
import { ConversationView } from '../../components/conversation/ConversationView';
@ -18,11 +18,12 @@ import { SmartConversationNotificationsSettings } from './ConversationNotificati
import { SmartGV1Members } from './GV1Members';
import { SmartGroupLinkManagement } from './GroupLinkManagement';
import { SmartGroupV2Permissions } from './GroupV2Permissions';
import { SmartMessageDetail } from './MessageDetail';
import { SmartPendingInvites } from './PendingInvites';
import { SmartStickerManager } from './StickerManager';
import { SmartTimeline } from './Timeline';
import { getIntl } from '../selectors/user';
import { getTopPanelRenderableByReact } from '../selectors/conversations';
import { getTopPanel } from '../selectors/conversations';
import { useComposerActions } from '../ducks/composer';
import { useConversationsActions } from '../ducks/conversations';
@ -33,10 +34,10 @@ export type PropsType = {
export function SmartConversationView({
conversationId,
}: PropsType): JSX.Element {
const { startConversation } = useConversationsActions();
const topPanel = useSelector<StateType, ReactPanelRenderType | undefined>(
getTopPanelRenderableByReact
const topPanel = useSelector<StateType, PanelRenderType | undefined>(
getTopPanel
);
const { startConversation } = useConversationsActions();
const { processAttachments } = useComposerActions();
const i18n = useSelector(getIntl);
@ -136,6 +137,14 @@ export function SmartConversationView({
);
}
if (topPanel.type === PanelType.MessageDetails) {
return (
<div className="panel message-detail-wrapper">
<SmartMessageDetail />
</div>
);
}
if (topPanel.type === PanelType.NotificationSettings) {
return (
<div className="panel">