minor tidying

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

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

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

Loading…
Cancel
Save