filled menu icons when active
This commit is contained in:
@@ -196,9 +196,10 @@ function NavLinkChat() {
|
|||||||
const { data: conversations } = useQuery(
|
const { data: conversations } = useQuery(
|
||||||
trpc.chat.conversations.fetchAll.queryOptions()
|
trpc.chat.conversations.fetchAll.queryOptions()
|
||||||
);
|
);
|
||||||
const selectedConversationId = useStore(
|
// const selectedConversationId = useStore(
|
||||||
(state) => state.selectedConversationId
|
// (state) => state.selectedConversationId
|
||||||
);
|
// );
|
||||||
|
const selectedConversationId = urlPathname.split("/chat/")[1];
|
||||||
|
|
||||||
async function handleDeleteConversation(conversationIdToDelete: string) {
|
async function handleDeleteConversation(conversationIdToDelete: string) {
|
||||||
await deleteConversation.mutateAsync(
|
await deleteConversation.mutateAsync(
|
||||||
@@ -268,11 +269,19 @@ function NavLinkChat() {
|
|||||||
className="hover-container"
|
className="hover-container"
|
||||||
leftSection={
|
leftSection={
|
||||||
<>
|
<>
|
||||||
<IconCircle size={16} stroke={1.5} className="show-by-default" />
|
<IconCircle
|
||||||
|
size={16}
|
||||||
|
stroke={1.5}
|
||||||
|
className={`show-by-default ${
|
||||||
|
selectedConversationId === conversation.id ? "none" : ""
|
||||||
|
}`}
|
||||||
|
/>
|
||||||
<IconCircleFilled
|
<IconCircleFilled
|
||||||
size={16}
|
size={16}
|
||||||
stroke={1.5}
|
stroke={1.5}
|
||||||
className="show-on-hover"
|
className={`show-on-hover ${
|
||||||
|
selectedConversationId === conversation.id ? "block" : ""
|
||||||
|
}`}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,3 +18,10 @@
|
|||||||
border: 1px solid var(--mantine-color-gray-9);
|
border: 1px solid var(--mantine-color-gray-9);
|
||||||
border-radius: var(--mantine-radius-sm);
|
border-radius: var(--mantine-radius-sm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.hover-container .block {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.hover-container .none {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user