mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-09 23:10:20 +08:00
feat: add more classname
This commit is contained in:
parent
13a1e866e6
commit
555e015836
@ -36,7 +36,7 @@ const HomePage: FC = () => {
|
|||||||
}, [state])
|
}, [state])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Container>
|
<Container id="home-page">
|
||||||
<Navbar activeAssistant={activeAssistant} activeTopic={activeTopic} setActiveTopic={setActiveTopic} />
|
<Navbar activeAssistant={activeAssistant} activeTopic={activeTopic} setActiveTopic={setActiveTopic} />
|
||||||
<ContentContainer id="content-container">
|
<ContentContainer id="content-container">
|
||||||
{showAssistants && (
|
{showAssistants && (
|
||||||
|
|||||||
@ -25,7 +25,7 @@ import { translateText } from '@renderer/services/TranslateService'
|
|||||||
import store, { useAppDispatch, useAppSelector } from '@renderer/store'
|
import store, { useAppDispatch, useAppSelector } from '@renderer/store'
|
||||||
import { setGenerating, setSearching } from '@renderer/store/runtime'
|
import { setGenerating, setSearching } from '@renderer/store/runtime'
|
||||||
import { Assistant, FileType, KnowledgeBase, Message, Topic } from '@renderer/types'
|
import { Assistant, FileType, KnowledgeBase, Message, Topic } from '@renderer/types'
|
||||||
import { delay, getFileExtension, uuid } from '@renderer/utils'
|
import { classNames, delay, getFileExtension, uuid } from '@renderer/utils'
|
||||||
import { documentExts, imageExts, textExts } from '@shared/config/constant'
|
import { documentExts, imageExts, textExts } from '@shared/config/constant'
|
||||||
import { Button, Popconfirm, Tooltip } from 'antd'
|
import { Button, Popconfirm, Tooltip } from 'antd'
|
||||||
import TextArea, { TextAreaRef } from 'antd/es/input/TextArea'
|
import TextArea, { TextAreaRef } from 'antd/es/input/TextArea'
|
||||||
@ -388,9 +388,12 @@ const Inputbar: FC<Props> = ({ assistant: _assistant, setActiveTopic }) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Container onDragOver={handleDragOver} onDrop={handleDrop}>
|
<Container onDragOver={handleDragOver} onDrop={handleDrop} className="inputbar">
|
||||||
<AttachmentPreview files={files} setFiles={setFiles} />
|
<AttachmentPreview files={files} setFiles={setFiles} />
|
||||||
<InputBarContainer id="inputbar" className={inputFocus ? 'focus' : ''} ref={containerRef}>
|
<InputBarContainer
|
||||||
|
id="inputbar"
|
||||||
|
className={classNames('inputbar-container', inputFocus && 'focus')}
|
||||||
|
ref={containerRef}>
|
||||||
<Textarea
|
<Textarea
|
||||||
value={text}
|
value={text}
|
||||||
onChange={(e) => setText(e.target.value)}
|
onChange={(e) => setText(e.target.value)}
|
||||||
|
|||||||
@ -54,7 +54,7 @@ const MessageHeader: FC<Props> = memo(({ assistant, model, message }) => {
|
|||||||
: undefined
|
: undefined
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Container>
|
<Container className="message-header">
|
||||||
<AvatarWrapper style={avatarStyle}>
|
<AvatarWrapper style={avatarStyle}>
|
||||||
{isAssistantMessage ? (
|
{isAssistantMessage ? (
|
||||||
<Avatar
|
<Avatar
|
||||||
|
|||||||
@ -41,7 +41,7 @@ const HeaderNavbar: FC<Props> = ({ activeAssistant }) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Navbar>
|
<Navbar className="home-navbar">
|
||||||
{showAssistants && (
|
{showAssistants && (
|
||||||
<NavbarLeft style={{ justifyContent: 'space-between', borderRight: 'none', padding: '0 8px' }}>
|
<NavbarLeft style={{ justifyContent: 'space-between', borderRight: 'none', padding: '0 8px' }}>
|
||||||
<NavbarIcon onClick={toggleShowAssistants} style={{ marginLeft: isMac ? 8 : 0 }}>
|
<NavbarIcon onClick={toggleShowAssistants} style={{ marginLeft: isMac ? 8 : 0 }}>
|
||||||
@ -52,7 +52,9 @@ const HeaderNavbar: FC<Props> = ({ activeAssistant }) => {
|
|||||||
</NavbarIcon>
|
</NavbarIcon>
|
||||||
</NavbarLeft>
|
</NavbarLeft>
|
||||||
)}
|
)}
|
||||||
<NavbarRight style={{ justifyContent: 'space-between', paddingRight: isWindows ? 140 : 12, flex: 1 }}>
|
<NavbarRight
|
||||||
|
style={{ justifyContent: 'space-between', paddingRight: isWindows ? 140 : 12, flex: 1 }}
|
||||||
|
className="home-navbar-right">
|
||||||
<HStack alignItems="center">
|
<HStack alignItems="center">
|
||||||
{!showAssistants && (
|
{!showAssistants && (
|
||||||
<NavbarIcon
|
<NavbarIcon
|
||||||
|
|||||||
@ -41,7 +41,7 @@ const Assistants: FC<Props> = ({
|
|||||||
|
|
||||||
const onDelete = useCallback(
|
const onDelete = useCallback(
|
||||||
(assistant: Assistant) => {
|
(assistant: Assistant) => {
|
||||||
const _assistant = last(assistants.filter((a) => a.id !== assistant.id))
|
const _assistant: Assistant | undefined = last(assistants.filter((a) => a.id !== assistant.id))
|
||||||
_assistant ? setActiveAssistant(_assistant) : onCreateDefaultAssistant()
|
_assistant ? setActiveAssistant(_assistant) : onCreateDefaultAssistant()
|
||||||
removeAssistant(assistant.id)
|
removeAssistant(assistant.id)
|
||||||
},
|
},
|
||||||
@ -135,7 +135,7 @@ const Assistants: FC<Props> = ({
|
|||||||
)
|
)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Container>
|
<Container className="assistants-tab">
|
||||||
<DragableList
|
<DragableList
|
||||||
list={assistants}
|
list={assistants}
|
||||||
onUpdate={updateAssistants}
|
onUpdate={updateAssistants}
|
||||||
|
|||||||
@ -117,7 +117,7 @@ const SettingsTab: FC<Props> = (props) => {
|
|||||||
}, [assistant])
|
}, [assistant])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Container>
|
<Container className="settings-tab">
|
||||||
<SettingGroup style={{ marginTop: 10 }}>
|
<SettingGroup style={{ marginTop: 10 }}>
|
||||||
<SettingSubtitle style={{ marginTop: 0 }}>
|
<SettingSubtitle style={{ marginTop: 0 }}>
|
||||||
{t('settings.messages.model.title')}{' '}
|
{t('settings.messages.model.title')}{' '}
|
||||||
|
|||||||
@ -186,7 +186,7 @@ const Topics: FC<Props> = ({ assistant: _assistant, activeTopic, setActiveTopic
|
|||||||
)
|
)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Container right={topicPosition === 'right'}>
|
<Container right={topicPosition === 'right'} className="topics-tab">
|
||||||
<DragableList list={assistant.topics} onUpdate={updateTopics}>
|
<DragableList list={assistant.topics} onUpdate={updateTopics}>
|
||||||
{(topic) => {
|
{(topic) => {
|
||||||
const isActive = topic.id === activeTopic?.id
|
const isActive = topic.id === activeTopic?.id
|
||||||
|
|||||||
@ -94,7 +94,7 @@ const HomeTabs: FC<Props> = ({ activeAssistant, activeTopic, setActiveAssistant,
|
|||||||
}, [position, tab, topicPosition])
|
}, [position, tab, topicPosition])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Container style={border}>
|
<Container style={border} className="home-tabs">
|
||||||
{showTab && (
|
{showTab && (
|
||||||
<Segmented
|
<Segmented
|
||||||
value={tab}
|
value={tab}
|
||||||
@ -125,7 +125,7 @@ const HomeTabs: FC<Props> = ({ activeAssistant, activeTopic, setActiveAssistant,
|
|||||||
block
|
block
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<TabContent>
|
<TabContent className="home-tabs-content">
|
||||||
{tab === 'assistants' && (
|
{tab === 'assistants' && (
|
||||||
<Assistants
|
<Assistants
|
||||||
activeAssistant={activeAssistant}
|
activeAssistant={activeAssistant}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user