style(Sidebar, Messages, ModelSettings): update icon styles and clean up unused imports
- Added 'icon' class to various icons in Sidebar for consistent styling. - Removed unused loading state from Messages component. - Cleaned up iconStyle variable in ModelSettings as it was no longer needed.
This commit is contained in:
parent
e22d076d67
commit
88cbb27557
@ -90,7 +90,7 @@ const Sidebar: FC = () => {
|
|||||||
<Menus>
|
<Menus>
|
||||||
<Tooltip title={t('docs.title')} mouseEnterDelay={0.8} placement="right">
|
<Tooltip title={t('docs.title')} mouseEnterDelay={0.8} placement="right">
|
||||||
<Icon theme={theme} onClick={onOpenDocs} className={minappShow && currentMinappId === docsId ? 'active' : ''}>
|
<Icon theme={theme} onClick={onOpenDocs} className={minappShow && currentMinappId === docsId ? 'active' : ''}>
|
||||||
<CircleHelp size={20} />
|
<CircleHelp size={20} className="icon" />
|
||||||
</Icon>
|
</Icon>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<Tooltip
|
<Tooltip
|
||||||
@ -98,7 +98,7 @@ const Sidebar: FC = () => {
|
|||||||
mouseEnterDelay={0.8}
|
mouseEnterDelay={0.8}
|
||||||
placement="right">
|
placement="right">
|
||||||
<Icon theme={theme} onClick={() => toggleTheme()}>
|
<Icon theme={theme} onClick={() => toggleTheme()}>
|
||||||
{theme === 'dark' ? <Moon size={20} /> : <Sun size={20} />}
|
{theme === 'dark' ? <Moon size={20} className="icon" /> : <Sun size={20} className="icon" />}
|
||||||
</Icon>
|
</Icon>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<Tooltip title={t('settings.title')} mouseEnterDelay={0.8} placement="right">
|
<Tooltip title={t('settings.title')} mouseEnterDelay={0.8} placement="right">
|
||||||
@ -108,7 +108,7 @@ const Sidebar: FC = () => {
|
|||||||
await to('/settings/provider')
|
await to('/settings/provider')
|
||||||
}}>
|
}}>
|
||||||
<Icon theme={theme} className={pathname.startsWith('/settings') && !minappShow ? 'active' : ''}>
|
<Icon theme={theme} className={pathname.startsWith('/settings') && !minappShow ? 'active' : ''}>
|
||||||
<Settings size={20} />
|
<Settings size={20} className="icon" />
|
||||||
</Icon>
|
</Icon>
|
||||||
</StyledLink>
|
</StyledLink>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
@ -130,13 +130,13 @@ const MainMenus: FC = () => {
|
|||||||
const isRoutes = (path: string): string => (pathname.startsWith(path) && !minappShow ? 'active' : '')
|
const isRoutes = (path: string): string => (pathname.startsWith(path) && !minappShow ? 'active' : '')
|
||||||
|
|
||||||
const iconMap = {
|
const iconMap = {
|
||||||
assistants: <MessageSquareQuote size={18} />,
|
assistants: <MessageSquareQuote size={18} className="icon" />,
|
||||||
agents: <Sparkle size={18} />,
|
agents: <Sparkle size={18} className="icon" />,
|
||||||
paintings: <Palette size={18} />,
|
paintings: <Palette size={18} className="icon" />,
|
||||||
translate: <Languages size={18} />,
|
translate: <Languages size={18} className="icon" />,
|
||||||
minapp: <LayoutGrid size={18} />,
|
minapp: <LayoutGrid size={18} className="icon" />,
|
||||||
knowledge: <LibraryBig size={18} />,
|
knowledge: <LibraryBig size={18} className="icon" />,
|
||||||
files: <Folder size={17} />
|
files: <Folder size={17} className="icon" />
|
||||||
}
|
}
|
||||||
|
|
||||||
const pathMap = {
|
const pathMap = {
|
||||||
@ -365,30 +365,19 @@ const Icon = styled.div<{ theme: string }>`
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
-webkit-app-region: none;
|
-webkit-app-region: none;
|
||||||
border: 0.5px solid transparent;
|
border: 0.5px solid transparent;
|
||||||
.iconfont,
|
|
||||||
.anticon {
|
|
||||||
color: var(--color-icon);
|
|
||||||
font-size: 20px;
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
.anticon {
|
|
||||||
font-size: 17px;
|
|
||||||
}
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: ${({ theme }) => (theme === 'dark' ? 'var(--color-black)' : 'var(--color-white)')};
|
background-color: ${({ theme }) => (theme === 'dark' ? 'var(--color-black)' : 'var(--color-white)')};
|
||||||
opacity: 0.8;
|
opacity: 0.8;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
.iconfont,
|
.icon {
|
||||||
.anticon {
|
|
||||||
color: var(--color-icon-white);
|
color: var(--color-icon-white);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
&.active {
|
&.active {
|
||||||
background-color: ${({ theme }) => (theme === 'dark' ? 'var(--color-black)' : 'var(--color-white)')};
|
background-color: ${({ theme }) => (theme === 'dark' ? 'var(--color-black)' : 'var(--color-white)')};
|
||||||
border: 0.5px solid var(--color-border);
|
border: 0.5px solid var(--color-border);
|
||||||
.iconfont,
|
.icon {
|
||||||
.anticon {
|
color: var(--color-primary);
|
||||||
color: var(--color-icon-white);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import Scrollbar from '@renderer/components/Scrollbar'
|
|||||||
import { LOAD_MORE_COUNT } from '@renderer/config/constant'
|
import { LOAD_MORE_COUNT } from '@renderer/config/constant'
|
||||||
import db from '@renderer/databases'
|
import db from '@renderer/databases'
|
||||||
import { useAssistant } from '@renderer/hooks/useAssistant'
|
import { useAssistant } from '@renderer/hooks/useAssistant'
|
||||||
import { useMessageOperations, useTopicLoading, useTopicMessages } from '@renderer/hooks/useMessageOperations'
|
import { useMessageOperations, useTopicMessages } from '@renderer/hooks/useMessageOperations'
|
||||||
import { useSettings } from '@renderer/hooks/useSettings'
|
import { useSettings } from '@renderer/hooks/useSettings'
|
||||||
import { useShortcut } from '@renderer/hooks/useShortcuts'
|
import { useShortcut } from '@renderer/hooks/useShortcuts'
|
||||||
import { autoRenameTopic, getTopic } from '@renderer/hooks/useTopic'
|
import { autoRenameTopic, getTopic } from '@renderer/hooks/useTopic'
|
||||||
@ -49,7 +49,6 @@ const Messages: React.FC<MessagesProps> = ({ assistant, topic, setActiveTopic })
|
|||||||
const [isProcessingContext, setIsProcessingContext] = useState(false)
|
const [isProcessingContext, setIsProcessingContext] = useState(false)
|
||||||
const messages = useTopicMessages(topic)
|
const messages = useTopicMessages(topic)
|
||||||
const { displayCount, updateMessages, clearTopicMessages, deleteMessage } = useMessageOperations(topic)
|
const { displayCount, updateMessages, clearTopicMessages, deleteMessage } = useMessageOperations(topic)
|
||||||
const loading = useTopicLoading(topic)
|
|
||||||
const messagesRef = useRef<Message[]>(messages)
|
const messagesRef = useRef<Message[]>(messages)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
@ -153,6 +153,4 @@ const ModelSettings: FC = () => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const iconStyle = { fontSize: 16, marginRight: 8 }
|
|
||||||
|
|
||||||
export default ModelSettings
|
export default ModelSettings
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user