mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-01 01:30:51 +08:00
style: adjust padding and layout in various components
* Updated padding in CustomCollapse for improved spacing. * Modified Messages component to conditionally apply padding based on prompt visibility. * Enhanced ModelListSearchBar by adding a flex display style for better alignment. * Increased gap in ProviderSetting's HStack for improved layout consistency.
This commit is contained in:
parent
f5f932def4
commit
f5f13a3eba
@ -36,7 +36,7 @@ const CustomCollapse: FC<CustomCollapseProps> = ({
|
|||||||
|
|
||||||
const defaultCollapseItemStyles = {
|
const defaultCollapseItemStyles = {
|
||||||
header: {
|
header: {
|
||||||
padding: '8px 16px',
|
padding: '3px 16px',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
justifyContent: 'space-between',
|
justifyContent: 'space-between',
|
||||||
background: 'var(--color-background-soft)',
|
background: 'var(--color-background-soft)',
|
||||||
|
|||||||
@ -225,7 +225,7 @@ const Messages: React.FC<MessagesProps> = ({ assistant, topic, setActiveTopic })
|
|||||||
return (
|
return (
|
||||||
<Container
|
<Container
|
||||||
id="messages"
|
id="messages"
|
||||||
style={{ maxWidth }}
|
style={{ maxWidth, paddingTop: showPrompt ? 10 : 0 }}
|
||||||
key={assistant.id}
|
key={assistant.id}
|
||||||
ref={containerRef}
|
ref={containerRef}
|
||||||
$right={topicPosition === 'left'}>
|
$right={topicPosition === 'left'}>
|
||||||
@ -319,7 +319,7 @@ interface ContainerProps {
|
|||||||
const Container = styled(Scrollbar)<ContainerProps>`
|
const Container = styled(Scrollbar)<ContainerProps>`
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column-reverse;
|
flex-direction: column-reverse;
|
||||||
padding: 10px 0 10px;
|
padding: 10px 0 20px;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
background-color: var(--color-background);
|
background-color: var(--color-background);
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
|
|||||||
@ -14,7 +14,7 @@ import {
|
|||||||
} from '@renderer/store/settings'
|
} from '@renderer/store/settings'
|
||||||
import { ThemeMode } from '@renderer/types'
|
import { ThemeMode } from '@renderer/types'
|
||||||
import { Button, Input, Segmented, Switch } from 'antd'
|
import { Button, Input, Segmented, Switch } from 'antd'
|
||||||
import { Minus, Plus } from 'lucide-react'
|
import { Minus, Plus, RotateCcw } 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'
|
||||||
import styled from 'styled-components'
|
import styled from 'styled-components'
|
||||||
@ -141,12 +141,10 @@ const DisplaySettings: FC = () => {
|
|||||||
<ZoomValue>{Math.round(currentZoom * 100)}%</ZoomValue>
|
<ZoomValue>{Math.round(currentZoom * 100)}%</ZoomValue>
|
||||||
<Button onClick={() => handleZoomFactor(0.1)} icon={<Plus size="14" />} />
|
<Button onClick={() => handleZoomFactor(0.1)} icon={<Plus size="14" />} />
|
||||||
<Button
|
<Button
|
||||||
onClick={() => {
|
onClick={() => handleZoomFactor(0, true)}
|
||||||
handleZoomFactor(0, true)
|
style={{ marginLeft: 8 }}
|
||||||
}}
|
icon={<RotateCcw size="14" />}
|
||||||
style={{ marginLeft: 8 }}>
|
/>
|
||||||
{t('settings.zoom.reset')}
|
|
||||||
</Button>
|
|
||||||
</ZoomButtonGroup>
|
</ZoomButtonGroup>
|
||||||
</SettingRow>
|
</SettingRow>
|
||||||
{isMac && (
|
{isMac && (
|
||||||
|
|||||||
@ -78,7 +78,7 @@ const ModelListSearchBar: React.FC<ModelListSearchBarProps> = ({ onSearch }) =>
|
|||||||
visible: { opacity: 1, transition: { duration: 0.1, delay: 0.3, ease: 'easeInOut' } },
|
visible: { opacity: 1, transition: { duration: 0.1, delay: 0.3, ease: 'easeInOut' } },
|
||||||
hidden: { opacity: 0, transition: { duration: 0.1, ease: 'easeInOut' } }
|
hidden: { opacity: 0, transition: { duration: 0.1, ease: 'easeInOut' } }
|
||||||
}}
|
}}
|
||||||
style={{ cursor: 'pointer' }}
|
style={{ cursor: 'pointer', display: 'flex' }}
|
||||||
onClick={() => setSearchVisible(true)}>
|
onClick={() => setSearchVisible(true)}>
|
||||||
<Tooltip title={t('models.search')} mouseEnterDelay={0.5}>
|
<Tooltip title={t('models.search')} mouseEnterDelay={0.5}>
|
||||||
<Search size={14} color="var(--color-icon)" />
|
<Search size={14} color="var(--color-icon)" />
|
||||||
|
|||||||
@ -404,7 +404,7 @@ const ProviderSetting: FC<Props> = ({ provider: _provider }) => {
|
|||||||
{provider.id === 'copilot' && <GithubCopilotSettings provider={provider} setApiKey={setApiKey} />}
|
{provider.id === 'copilot' && <GithubCopilotSettings provider={provider} setApiKey={setApiKey} />}
|
||||||
<SettingSubtitle style={{ marginBottom: 5 }}>
|
<SettingSubtitle style={{ marginBottom: 5 }}>
|
||||||
<Space align="center" style={{ width: '100%', justifyContent: 'space-between' }}>
|
<Space align="center" style={{ width: '100%', justifyContent: 'space-between' }}>
|
||||||
<HStack alignItems="center" gap={5}>
|
<HStack alignItems="center" gap={8} mb={5}>
|
||||||
<SettingSubtitle style={{ marginTop: 0 }}>{t('common.models')}</SettingSubtitle>
|
<SettingSubtitle style={{ marginTop: 0 }}>{t('common.models')}</SettingSubtitle>
|
||||||
{!isEmpty(models) && <ModelListSearchBar onSearch={setModelSearchText} />}
|
{!isEmpty(models) && <ModelListSearchBar onSearch={setModelSearchText} />}
|
||||||
</HStack>
|
</HStack>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user