minor tidying

pull/1745/head
Warrick Corfe-Tan 4 years ago
parent cf6ac09300
commit 535a66b879

@ -64,6 +64,7 @@ const ConversationListItem = (props: Props) => {
isMe,
isPinned,
isTyping,
type,
lastMessage,
memberAvatars,
} = props;
@ -72,11 +73,6 @@ const ConversationListItem = (props: Props) => {
const dispatch = useDispatch();
const menuProps: PropsContextConversationItem = {
...props,
triggerId,
};
return (
<div key={key}>
<div
@ -124,7 +120,7 @@ const ConversationListItem = (props: Props) => {
</div>
</div>
<Portal>
<ConversationListItemContextMenu {...menuProps} />
<ConversationListItemContextMenu id={id} triggerId={triggerId} type={type} isMe={isMe} />
</Portal>
</div>
);

@ -1,6 +1,8 @@
import React from 'react';
import { animation, Menu } from 'react-contexify';
import { useSelector } from 'react-redux';
import { ConversationTypeEnum } from '../../../models/conversation';
import { getFocusedSection } from '../../../state/selectors/section';
import { SectionType } from '../ActionsPanel';
import {
@ -43,9 +45,7 @@ export const ConversationListItemContextMenu = (props: PropsContextConversationI
} = props;
const isGroup = type === 'group';
const isMessagesSection =
window.inboxStore?.getState().section.focusedSection === SectionType.Message;
const isMessagesSection = useSelector(getFocusedSection) === SectionType.Message;
const pinMenuItem = isMessagesSection ? (
<MenuItemPinConversation conversationId={conversationId} />
) : null;

Loading…
Cancel
Save