nice maximum for shortcuts
This commit is contained in:
@@ -21,6 +21,7 @@ import { useKeyPressEvent, useRendersCount } from 'react-use';
|
|||||||
import Conversation from '@nirvana/core/src/models/conversation.model';
|
import Conversation from '@nirvana/core/src/models/conversation.model';
|
||||||
import ConversationLabel from '../subcomponents/ConversationLabel';
|
import ConversationLabel from '../subcomponents/ConversationLabel';
|
||||||
import KeyboardShortcutLabel from './KeyboardShortcutLabel';
|
import KeyboardShortcutLabel from './KeyboardShortcutLabel';
|
||||||
|
import { NirvanaRules } from '../util/rules';
|
||||||
import { SUPPORT_DISPLAY_NAME } from '../util/support';
|
import { SUPPORT_DISPLAY_NAME } from '../util/support';
|
||||||
import useAuth from '../providers/AuthProvider';
|
import useAuth from '../providers/AuthProvider';
|
||||||
import useTerminal from './Terminal';
|
import useTerminal from './Terminal';
|
||||||
@@ -115,7 +116,7 @@ export function ConversationRow({
|
|||||||
console.warn('RENDER COUNT | CONVERSATION LIST ROW | ', rendersCount);
|
console.warn('RENDER COUNT | CONVERSATION LIST ROW | ', rendersCount);
|
||||||
|
|
||||||
const keyboardShortcut = useMemo(() => {
|
const keyboardShortcut = useMemo(() => {
|
||||||
if (index < 9) {
|
if (index < NirvanaRules.topXConversationsWithShortcuts) {
|
||||||
return index + 1;
|
return index + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -150,6 +151,7 @@ export function ConversationRow({
|
|||||||
sx={{ ml: 2, mr: 'auto', color: 'GrayText', overflow: 'auto' }}
|
sx={{ ml: 2, mr: 'auto', color: 'GrayText', overflow: 'auto' }}
|
||||||
>
|
>
|
||||||
{keyboardShortcut && <KeyboardShortcutLabel label={keyboardShortcut.toString()} />}
|
{keyboardShortcut && <KeyboardShortcutLabel label={keyboardShortcut.toString()} />}
|
||||||
|
|
||||||
<ConversationLabel
|
<ConversationLabel
|
||||||
users={conversation.userCache ?? []}
|
users={conversation.userCache ?? []}
|
||||||
conversationName={conversation.name}
|
conversationName={conversation.name}
|
||||||
|
|||||||
@@ -4,4 +4,6 @@ export const NirvanaRules = {
|
|||||||
maxMembersPerConversation: 8,
|
maxMembersPerConversation: 8,
|
||||||
|
|
||||||
maxPriorityConvos: 5,
|
maxPriorityConvos: 5,
|
||||||
|
|
||||||
|
topXConversationsWithShortcuts: 3,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user