showing proirity vs. inbox
This commit is contained in:
Vendored
+1
-1
@@ -8,7 +8,7 @@
|
|||||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||||
"workbench.colorTheme": "Default Light+",
|
"workbench.colorTheme": "Default Light+",
|
||||||
"javascript.format.semicolons": "insert",
|
"javascript.format.semicolons": "insert",
|
||||||
"window.zoomLevel": 1
|
"window.zoomLevel": 0
|
||||||
|
|
||||||
// "eslint.workingDirectories": ["./packages/desktop"]
|
// "eslint.workingDirectories": ["./packages/desktop"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ export function ConversationList() {
|
|||||||
</ListSubheader>
|
</ListSubheader>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{Object.values(conversationMap).map((currentConversation, index) => (
|
{masterConversations[0].map((currentConversation, index) => (
|
||||||
<ConversationRow
|
<ConversationRow
|
||||||
key={`${currentConversation._id.toString()}-priorityConvoList`}
|
key={`${currentConversation._id.toString()}-priorityConvoList`}
|
||||||
conversation={currentConversation}
|
conversation={currentConversation}
|
||||||
@@ -117,7 +117,15 @@ export function ConversationList() {
|
|||||||
<Typography variant="subtitle2"> Inbox</Typography>
|
<Typography variant="subtitle2"> Inbox</Typography>
|
||||||
</ListSubheader>
|
</ListSubheader>
|
||||||
}
|
}
|
||||||
></List>
|
>
|
||||||
|
{masterConversations[1].map((currentConversation, index) => (
|
||||||
|
<ConversationRow
|
||||||
|
key={`${currentConversation._id.toString()}-inboxConvoList`}
|
||||||
|
conversation={currentConversation}
|
||||||
|
index={index}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</List>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -143,14 +151,6 @@ export function ConversationRow({
|
|||||||
const rendersCount = useRendersCount();
|
const rendersCount = useRendersCount();
|
||||||
console.warn('RENDER COUNT | CONVERSATION LIST ROW | ', rendersCount);
|
console.warn('RENDER COUNT | CONVERSATION LIST ROW | ', rendersCount);
|
||||||
|
|
||||||
const keyboardShortcut = useMemo(() => {
|
|
||||||
if (index < NirvanaRules.topXConversationsWithShortcuts) {
|
|
||||||
return index + 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return undefined;
|
|
||||||
}, [index]);
|
|
||||||
|
|
||||||
const handleSelectConversation = useCallback(() => {
|
const handleSelectConversation = useCallback(() => {
|
||||||
if (onClick) {
|
if (onClick) {
|
||||||
onClick();
|
onClick();
|
||||||
@@ -159,6 +159,29 @@ export function ConversationRow({
|
|||||||
selectConversation(conversation._id.toString(), false);
|
selectConversation(conversation._id.toString(), false);
|
||||||
}, [conversation, selectConversation, onClick]);
|
}, [conversation, selectConversation, onClick]);
|
||||||
|
|
||||||
|
const currentConversationMember = useMemo(() => {
|
||||||
|
const currentConvoMember = conversation.members.find(
|
||||||
|
(mem) => mem._id.toString() === user._id.toString(),
|
||||||
|
);
|
||||||
|
return currentConvoMember;
|
||||||
|
}, [conversation.members, user]);
|
||||||
|
|
||||||
|
const isPriority = useMemo(() => {
|
||||||
|
if (currentConversationMember && currentConversationMember.memberState === 'priority') {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}, [currentConversationMember]);
|
||||||
|
|
||||||
|
const keyboardShortcut = useMemo(() => {
|
||||||
|
if (index < NirvanaRules.topXConversationsWithShortcuts && isPriority) {
|
||||||
|
return index + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return undefined;
|
||||||
|
}, [index, isPriority]);
|
||||||
|
|
||||||
useKeyPressEvent(`${keyboardShortcut?.toString()}`, handleSelectConversation);
|
useKeyPressEvent(`${keyboardShortcut?.toString()}`, handleSelectConversation);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user