|
|
|
@ -5,6 +5,7 @@ import { contextMenu } from 'react-contexify';
|
|
|
|
|
import { createPortal } from 'react-dom';
|
|
|
|
|
import { useDispatch, useSelector } from 'react-redux';
|
|
|
|
|
|
|
|
|
|
import { CSSProperties } from 'styled-components';
|
|
|
|
|
import { Avatar, AvatarSize } from '../../avatar/Avatar';
|
|
|
|
|
|
|
|
|
|
import { openConversationWithMessages } from '../../../state/ducks/conversations';
|
|
|
|
@ -24,16 +25,11 @@ import {
|
|
|
|
|
} from '../../../hooks/useParamSelector';
|
|
|
|
|
import { isSearching } from '../../../state/selectors/search';
|
|
|
|
|
import { useSelectedConversationKey } from '../../../state/selectors/selectedConversation';
|
|
|
|
|
import { SpacerXS } from '../../basic/Text';
|
|
|
|
|
import { MemoConversationListItemContextMenu } from '../../menu/ConversationListItemContextMenu';
|
|
|
|
|
import { ConversationListItemHeaderItem } from './HeaderItem';
|
|
|
|
|
import { MessageItem } from './MessageItem';
|
|
|
|
|
|
|
|
|
|
type PropsHousekeeping = {
|
|
|
|
|
style?: object;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
type Props = { conversationId: string } & PropsHousekeeping;
|
|
|
|
|
|
|
|
|
|
const Portal = ({ children }: { children: ReactNode }) => {
|
|
|
|
|
return createPortal(children, document.querySelector('.inbox.index') as Element);
|
|
|
|
|
};
|
|
|
|
@ -65,6 +61,7 @@ const AvatarItem = () => {
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
type Props = { conversationId: string; style?: CSSProperties };
|
|
|
|
|
|
|
|
|
|
const ConversationListItemInner = (props: Props) => {
|
|
|
|
|
const { conversationId, style } = props;
|
|
|
|
@ -125,7 +122,12 @@ const ConversationListItemInner = (props: Props) => {
|
|
|
|
|
<AvatarItem />
|
|
|
|
|
<div className="module-conversation-list-item__content">
|
|
|
|
|
<ConversationListItemHeaderItem />
|
|
|
|
|
<MessageItem />
|
|
|
|
|
{!isSearch ? (
|
|
|
|
|
<>
|
|
|
|
|
<SpacerXS />
|
|
|
|
|
<MessageItem />
|
|
|
|
|
</>
|
|
|
|
|
) : null}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<Portal>
|
|
|
|
|