mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-24 10:40:07 +08:00
refactor: streamline SettingsTab layout and remove unnecessary Divider components
This commit is contained in:
parent
7706a4cc36
commit
f0e43e9bcd
@ -50,7 +50,7 @@ import {
|
|||||||
TranslateLanguageVarious
|
TranslateLanguageVarious
|
||||||
} from '@renderer/types'
|
} from '@renderer/types'
|
||||||
import { modalConfirm } from '@renderer/utils'
|
import { modalConfirm } from '@renderer/utils'
|
||||||
import { Button, Col, Divider, InputNumber, Row, Select, Slider, Switch, Tooltip } from 'antd'
|
import { Button, Col, InputNumber, Row, Select, Slider, Switch, Tooltip } from 'antd'
|
||||||
import { CircleHelp, RotateCcw, Settings2 } from 'lucide-react'
|
import { CircleHelp, RotateCcw, Settings2 } from 'lucide-react'
|
||||||
import { FC, useCallback, useEffect, useMemo, useState } from 'react'
|
import { FC, useCallback, useEffect, useMemo, useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
@ -236,7 +236,7 @@ const SettingsTab: FC<Props> = (props) => {
|
|||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
<Divider style={{ margin: '10px 0' }} />
|
<SettingDivider />
|
||||||
<SettingRow>
|
<SettingRow>
|
||||||
<SettingRowTitleSmall>{t('models.stream_output')}</SettingRowTitleSmall>
|
<SettingRowTitleSmall>{t('models.stream_output')}</SettingRowTitleSmall>
|
||||||
<Switch
|
<Switch
|
||||||
@ -249,7 +249,7 @@ const SettingsTab: FC<Props> = (props) => {
|
|||||||
/>
|
/>
|
||||||
</SettingRow>
|
</SettingRow>
|
||||||
<SettingDivider />
|
<SettingDivider />
|
||||||
<Row align="middle" justify="space-between" style={{ marginBottom: 10 }}>
|
<SettingRow>
|
||||||
<HStack alignItems="center">
|
<HStack alignItems="center">
|
||||||
<Label>{t('chat.settings.max_tokens')}</Label>
|
<Label>{t('chat.settings.max_tokens')}</Label>
|
||||||
<Tooltip title={t('chat.settings.max_tokens.tip')}>
|
<Tooltip title={t('chat.settings.max_tokens.tip')}>
|
||||||
@ -274,7 +274,7 @@ const SettingsTab: FC<Props> = (props) => {
|
|||||||
onUpdateAssistantSettings({ enableMaxTokens: enabled })
|
onUpdateAssistantSettings({ enableMaxTokens: enabled })
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Row>
|
</SettingRow>
|
||||||
{enableMaxTokens && (
|
{enableMaxTokens && (
|
||||||
<Row align="middle" gutter={10}>
|
<Row align="middle" gutter={10}>
|
||||||
<Col span={24}>
|
<Col span={24}>
|
||||||
@ -292,6 +292,7 @@ const SettingsTab: FC<Props> = (props) => {
|
|||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
)}
|
)}
|
||||||
|
<SettingDivider />
|
||||||
</SettingGroup>
|
</SettingGroup>
|
||||||
</CollapsibleSettingGroup>
|
</CollapsibleSettingGroup>
|
||||||
<CollapsibleSettingGroup title={t('settings.messages.title')} defaultExpanded={true}>
|
<CollapsibleSettingGroup title={t('settings.messages.title')} defaultExpanded={true}>
|
||||||
@ -408,6 +409,7 @@ const SettingsTab: FC<Props> = (props) => {
|
|||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
<SettingDivider />
|
||||||
</SettingGroup>
|
</SettingGroup>
|
||||||
</CollapsibleSettingGroup>
|
</CollapsibleSettingGroup>
|
||||||
<CollapsibleSettingGroup title={t('chat.settings.code.title')} defaultExpanded={true}>
|
<CollapsibleSettingGroup title={t('chat.settings.code.title')} defaultExpanded={true}>
|
||||||
@ -536,6 +538,7 @@ const SettingsTab: FC<Props> = (props) => {
|
|||||||
<Switch size="small" checked={codeWrappable} onChange={(checked) => dispatch(setCodeWrappable(checked))} />
|
<Switch size="small" checked={codeWrappable} onChange={(checked) => dispatch(setCodeWrappable(checked))} />
|
||||||
</SettingRow>
|
</SettingRow>
|
||||||
</SettingGroup>
|
</SettingGroup>
|
||||||
|
<SettingDivider />
|
||||||
</CollapsibleSettingGroup>
|
</CollapsibleSettingGroup>
|
||||||
<CollapsibleSettingGroup title={t('settings.messages.input.title')} defaultExpanded={true}>
|
<CollapsibleSettingGroup title={t('settings.messages.input.title')} defaultExpanded={true}>
|
||||||
<SettingGroup>
|
<SettingGroup>
|
||||||
|
|||||||
@ -40,7 +40,6 @@ const SettingGroup = styled.div<{ theme?: ThemeMode }>`
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
margin-bottom: 10px;
|
|
||||||
`
|
`
|
||||||
|
|
||||||
const GroupHeader = styled.div`
|
const GroupHeader = styled.div`
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user