From 1e29f7dd9c8ddb4168b0e9d8e91df003c0075365 Mon Sep 17 00:00:00 2001 From: kangfenmao Date: Wed, 4 Sep 2024 22:31:39 +0800 Subject: [PATCH] fix: left sidebar icon --- src/renderer/src/pages/home/Assistants.tsx | 18 ++++++++++-------- src/renderer/src/pages/home/Navbar.tsx | 10 ++++++---- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/renderer/src/pages/home/Assistants.tsx b/src/renderer/src/pages/home/Assistants.tsx index 9866a01356..2ce3f41a3b 100644 --- a/src/renderer/src/pages/home/Assistants.tsx +++ b/src/renderer/src/pages/home/Assistants.tsx @@ -86,14 +86,10 @@ const Assistants: FC = ({ activeAssistant, setActiveAssistant, onCreateAs }) } - if (assistant.id === activeAssistant?.id) { - toggleShowTopics() - } - EventEmitter.emit(EVENT_NAMES.SWITCH_TOPIC_SIDEBAR) setActiveAssistant(assistant) }, - [activeAssistant?.id, generating, setActiveAssistant, t, toggleShowTopics] + [generating, setActiveAssistant, t] ) return ( @@ -105,7 +101,13 @@ const Assistants: FC = ({ activeAssistant, setActiveAssistant, onCreateAs onClick={() => onSwitchAssistant(assistant)} className={assistant.id === activeAssistant?.id ? 'active' : ''}> {assistant.name || t('chat.default.name')} - + { + if (assistant.id === activeAssistant?.id) { + toggleShowTopics() + } + }}> {false && {assistant.topics.length}} @@ -144,7 +146,7 @@ const AssistantItem = styled.div` opacity: 0; color: var(--color-text-3); } - &:hover { + /* &:hover { background-color: var(--color-background-soft); .topics-count { display: none; @@ -152,7 +154,7 @@ const AssistantItem = styled.div` .iconfont { opacity: 1; } - } + } */ &.active { background-color: var(--color-background-mute); .topics-count { diff --git a/src/renderer/src/pages/home/Navbar.tsx b/src/renderer/src/pages/home/Navbar.tsx index c9cd489331..71797a25af 100644 --- a/src/renderer/src/pages/home/Navbar.tsx +++ b/src/renderer/src/pages/home/Navbar.tsx @@ -43,7 +43,7 @@ const HeaderNavbar: FC = ({ activeAssistant, setActiveAssistant, setActiv {showAssistants && ( - + @@ -61,7 +61,7 @@ const HeaderNavbar: FC = ({ activeAssistant, setActiveAssistant, setActiv {!showAssistants && ( - + )} {showAssistants && ( @@ -78,8 +78,10 @@ const HeaderNavbar: FC = ({ activeAssistant, setActiveAssistant, setActiv {!showAssistants && !showTopics && ( - toggleShowAssistants()} style={{ marginRight: isMac ? 8 : 25 }}> - + toggleShowAssistants()} + style={{ marginRight: isMac ? 8 : 25, marginLeft: isMac ? 8 : 0 }}> + )}