mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-04 20:00:00 +08:00
feat: add 'code_tools' to sidebar icons and update related components
This commit is contained in:
parent
973ece9eb9
commit
cffaf99b17
@ -144,7 +144,8 @@ const sidebarIconKeyMap = {
|
|||||||
translate: 'translate.title',
|
translate: 'translate.title',
|
||||||
minapp: 'minapp.title',
|
minapp: 'minapp.title',
|
||||||
knowledge: 'knowledge.title',
|
knowledge: 'knowledge.title',
|
||||||
files: 'files.title'
|
files: 'files.title',
|
||||||
|
code_tools: 'code.title'
|
||||||
} as const
|
} as const
|
||||||
|
|
||||||
export const getSidebarIconLabel = (key: string): string => {
|
export const getSidebarIconLabel = (key: string): string => {
|
||||||
|
|||||||
@ -11,7 +11,7 @@ import { getSidebarIconLabel } from '@renderer/i18n/label'
|
|||||||
import { useAppDispatch } from '@renderer/store'
|
import { useAppDispatch } from '@renderer/store'
|
||||||
import { setSidebarIcons } from '@renderer/store/settings'
|
import { setSidebarIcons } from '@renderer/store/settings'
|
||||||
import { message } from 'antd'
|
import { message } from 'antd'
|
||||||
import { FileSearch, Folder, Languages, LayoutGrid, MessageSquareQuote, Palette, Sparkle } from 'lucide-react'
|
import { Code, FileSearch, Folder, Languages, LayoutGrid, MessageSquareQuote, Palette, Sparkle } from 'lucide-react'
|
||||||
import { FC, useCallback, useMemo } from 'react'
|
import { FC, useCallback, useMemo } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import styled from 'styled-components'
|
import styled from 'styled-components'
|
||||||
@ -116,7 +116,8 @@ const SidebarIconsManager: FC<SidebarIconsManagerProps> = ({
|
|||||||
translate: <Languages size={16} />,
|
translate: <Languages size={16} />,
|
||||||
minapp: <LayoutGrid size={16} />,
|
minapp: <LayoutGrid size={16} />,
|
||||||
knowledge: <FileSearch size={16} />,
|
knowledge: <FileSearch size={16} />,
|
||||||
files: <Folder size={15} />
|
files: <Folder size={15} />,
|
||||||
|
code_tools: <Code size={16} />
|
||||||
}),
|
}),
|
||||||
[]
|
[]
|
||||||
)
|
)
|
||||||
@ -206,15 +207,14 @@ const IconColumn = styled.div`
|
|||||||
`
|
`
|
||||||
|
|
||||||
const IconList = styled.div`
|
const IconList = styled.div`
|
||||||
height: 365px;
|
height: 400px;
|
||||||
min-height: 365px;
|
min-height: 400px;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
background: var(--color-background-soft);
|
background: var(--color-background-soft);
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
border: 1px solid var(--color-border);
|
border: 1px solid var(--color-border);
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
overflow-y: hidden;
|
|
||||||
`
|
`
|
||||||
|
|
||||||
const IconItem = styled.div`
|
const IconItem = styled.div`
|
||||||
|
|||||||
@ -40,8 +40,9 @@ const PopupContainer: React.FC<Props> = ({ resolve }) => {
|
|||||||
afterClose={onClose}
|
afterClose={onClose}
|
||||||
transitionName="animation-move-down"
|
transitionName="animation-move-down"
|
||||||
width="80vw"
|
width="80vw"
|
||||||
|
footer={null}
|
||||||
centered>
|
centered>
|
||||||
<SettingContainer theme={theme} style={{ padding: '10px 0' }}>
|
<SettingContainer theme={theme} style={{ padding: '10px 0', background: 'transparent' }}>
|
||||||
<TranslatePromptSettings />
|
<TranslatePromptSettings />
|
||||||
<SettingGroup theme={theme} style={{ flex: 1 }}>
|
<SettingGroup theme={theme} style={{ flex: 1 }}>
|
||||||
<CustomLanguageSettings />
|
<CustomLanguageSettings />
|
||||||
|
|||||||
@ -38,7 +38,8 @@ export const DEFAULT_SIDEBAR_ICONS: SidebarIcon[] = [
|
|||||||
'translate',
|
'translate',
|
||||||
'minapp',
|
'minapp',
|
||||||
'knowledge',
|
'knowledge',
|
||||||
'files'
|
'files',
|
||||||
|
'code_tools'
|
||||||
]
|
]
|
||||||
|
|
||||||
export interface NutstoreSyncRuntime extends RemoteSyncState {}
|
export interface NutstoreSyncRuntime extends RemoteSyncState {}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user