mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-06 21:35:52 +08:00
fix: left sidebar icon
This commit is contained in:
parent
ad76ef7af9
commit
1e29f7dd9c
@ -86,14 +86,10 @@ const Assistants: FC<Props> = ({ activeAssistant, setActiveAssistant, onCreateAs
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
if (assistant.id === activeAssistant?.id) {
|
|
||||||
toggleShowTopics()
|
|
||||||
}
|
|
||||||
|
|
||||||
EventEmitter.emit(EVENT_NAMES.SWITCH_TOPIC_SIDEBAR)
|
EventEmitter.emit(EVENT_NAMES.SWITCH_TOPIC_SIDEBAR)
|
||||||
setActiveAssistant(assistant)
|
setActiveAssistant(assistant)
|
||||||
},
|
},
|
||||||
[activeAssistant?.id, generating, setActiveAssistant, t, toggleShowTopics]
|
[generating, setActiveAssistant, t]
|
||||||
)
|
)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -105,7 +101,13 @@ const Assistants: FC<Props> = ({ activeAssistant, setActiveAssistant, onCreateAs
|
|||||||
onClick={() => onSwitchAssistant(assistant)}
|
onClick={() => onSwitchAssistant(assistant)}
|
||||||
className={assistant.id === activeAssistant?.id ? 'active' : ''}>
|
className={assistant.id === activeAssistant?.id ? 'active' : ''}>
|
||||||
<AssistantName className="name">{assistant.name || t('chat.default.name')}</AssistantName>
|
<AssistantName className="name">{assistant.name || t('chat.default.name')}</AssistantName>
|
||||||
<ArrowRightButton className="arrow-button">
|
<ArrowRightButton
|
||||||
|
className="arrow-button"
|
||||||
|
onClick={() => {
|
||||||
|
if (assistant.id === activeAssistant?.id) {
|
||||||
|
toggleShowTopics()
|
||||||
|
}
|
||||||
|
}}>
|
||||||
<i className="iconfont icon-gridlines" />
|
<i className="iconfont icon-gridlines" />
|
||||||
</ArrowRightButton>
|
</ArrowRightButton>
|
||||||
{false && <TopicCount className="topics-count">{assistant.topics.length}</TopicCount>}
|
{false && <TopicCount className="topics-count">{assistant.topics.length}</TopicCount>}
|
||||||
@ -144,7 +146,7 @@ const AssistantItem = styled.div`
|
|||||||
opacity: 0;
|
opacity: 0;
|
||||||
color: var(--color-text-3);
|
color: var(--color-text-3);
|
||||||
}
|
}
|
||||||
&:hover {
|
/* &:hover {
|
||||||
background-color: var(--color-background-soft);
|
background-color: var(--color-background-soft);
|
||||||
.topics-count {
|
.topics-count {
|
||||||
display: none;
|
display: none;
|
||||||
@ -152,7 +154,7 @@ const AssistantItem = styled.div`
|
|||||||
.iconfont {
|
.iconfont {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
}
|
} */
|
||||||
&.active {
|
&.active {
|
||||||
background-color: var(--color-background-mute);
|
background-color: var(--color-background-mute);
|
||||||
.topics-count {
|
.topics-count {
|
||||||
|
|||||||
@ -43,7 +43,7 @@ const HeaderNavbar: FC<Props> = ({ activeAssistant, setActiveAssistant, setActiv
|
|||||||
{showAssistants && (
|
{showAssistants && (
|
||||||
<NavbarLeft style={{ justifyContent: 'space-between', borderRight: 'none', padding: '0 8px' }}>
|
<NavbarLeft style={{ justifyContent: 'space-between', borderRight: 'none', padding: '0 8px' }}>
|
||||||
<NewButton onClick={toggleShowAssistants} style={{ marginLeft: isMac ? 8 : 0 }}>
|
<NewButton onClick={toggleShowAssistants} style={{ marginLeft: isMac ? 8 : 0 }}>
|
||||||
<i className="iconfont icon-sidebar-left" />
|
<i className="iconfont icon-sidebar-right" />
|
||||||
</NewButton>
|
</NewButton>
|
||||||
<NewButton onClick={onCreateAssistant} style={{ marginRight: 6 }}>
|
<NewButton onClick={onCreateAssistant} style={{ marginRight: 6 }}>
|
||||||
<i className="iconfont icon-a-addchat" />
|
<i className="iconfont icon-a-addchat" />
|
||||||
@ -61,7 +61,7 @@ const HeaderNavbar: FC<Props> = ({ activeAssistant, setActiveAssistant, setActiv
|
|||||||
<HStack alignItems="center">
|
<HStack alignItems="center">
|
||||||
{!showAssistants && (
|
{!showAssistants && (
|
||||||
<NewButton onClick={toggleShowAssistants} style={{ marginRight: isMac ? 8 : 25 }}>
|
<NewButton onClick={toggleShowAssistants} style={{ marginRight: isMac ? 8 : 25 }}>
|
||||||
<i className="iconfont icon-sidebar-right" />
|
<i className="iconfont icon-sidebar-left" />
|
||||||
</NewButton>
|
</NewButton>
|
||||||
)}
|
)}
|
||||||
{showAssistants && (
|
{showAssistants && (
|
||||||
@ -78,8 +78,10 @@ const HeaderNavbar: FC<Props> = ({ activeAssistant, setActiveAssistant, setActiv
|
|||||||
<NavbarRight style={{ justifyContent: 'space-between', paddingRight: isWindows ? 130 : 12, flex: 1 }}>
|
<NavbarRight style={{ justifyContent: 'space-between', paddingRight: isWindows ? 130 : 12, flex: 1 }}>
|
||||||
<HStack alignItems="center">
|
<HStack alignItems="center">
|
||||||
{!showAssistants && !showTopics && (
|
{!showAssistants && !showTopics && (
|
||||||
<NewButton onClick={() => toggleShowAssistants()} style={{ marginRight: isMac ? 8 : 25 }}>
|
<NewButton
|
||||||
<i className="iconfont icon-sidebar-right" />
|
onClick={() => toggleShowAssistants()}
|
||||||
|
style={{ marginRight: isMac ? 8 : 25, marginLeft: isMac ? 8 : 0 }}>
|
||||||
|
<i className="iconfont icon-sidebar-left" />
|
||||||
</NewButton>
|
</NewButton>
|
||||||
)}
|
)}
|
||||||
<TitleText>
|
<TitleText>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user