mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-26 11:44:28 +08:00
refactor(Settings): update input components to use Space.Compact for better layout and consistency across various settings pages
This commit is contained in:
parent
76387643f7
commit
88e251cee7
@ -38,7 +38,15 @@ const AntdProvider: FC<PropsWithChildren> = ({ children }) => {
|
||||
boxShadowSecondary: 'none',
|
||||
defaultShadow: 'none',
|
||||
dangerShadow: 'none',
|
||||
primaryShadow: 'none'
|
||||
primaryShadow: 'none',
|
||||
controlHeight: 30,
|
||||
paddingInline: 10
|
||||
},
|
||||
Input: {
|
||||
controlHeight: 30
|
||||
},
|
||||
Select: {
|
||||
controlHeight: 30
|
||||
},
|
||||
Collapse: {
|
||||
headerBg: 'transparent'
|
||||
|
||||
@ -39,7 +39,6 @@ const AgentsSubscribeUrlSettings: FC = () => {
|
||||
/>
|
||||
</HStack>
|
||||
</SettingRow>
|
||||
<SettingDivider />
|
||||
</SettingGroup>
|
||||
)
|
||||
}
|
||||
|
||||
@ -4,7 +4,7 @@ import { useTheme } from '@renderer/context/ThemeProvider'
|
||||
import { useMinappPopup } from '@renderer/hooks/useMinappPopup'
|
||||
import { RootState, useAppDispatch } from '@renderer/store'
|
||||
import { setJoplinExportReasoning, setJoplinToken, setJoplinUrl } from '@renderer/store/settings'
|
||||
import { Button, Switch, Tooltip } from 'antd'
|
||||
import { Button, Space, Switch, Tooltip } from 'antd'
|
||||
import Input from 'antd/es/input/Input'
|
||||
import { FC } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
@ -106,14 +106,15 @@ const JoplinSettings: FC = () => {
|
||||
</Tooltip>
|
||||
</SettingRowTitle>
|
||||
<HStack alignItems="center" gap="5px" style={{ width: 315 }}>
|
||||
<Input
|
||||
type="password"
|
||||
value={joplinToken || ''}
|
||||
onChange={handleJoplinTokenChange}
|
||||
style={{ width: 250 }}
|
||||
placeholder={t('settings.data.joplin.token_placeholder')}
|
||||
/>
|
||||
<Button onClick={handleJoplinConnectionCheck}>{t('settings.data.joplin.check.button')}</Button>
|
||||
<Space.Compact style={{ width: '100%' }}>
|
||||
<Input
|
||||
type="password"
|
||||
value={joplinToken || ''}
|
||||
onChange={handleJoplinTokenChange}
|
||||
placeholder={t('settings.data.joplin.token_placeholder')}
|
||||
/>
|
||||
<Button onClick={handleJoplinConnectionCheck}>{t('settings.data.joplin.check.button')}</Button>
|
||||
</Space.Compact>
|
||||
</HStack>
|
||||
</SettingRow>
|
||||
<SettingDivider />
|
||||
|
||||
@ -10,7 +10,7 @@ import {
|
||||
setNotionExportReasoning,
|
||||
setNotionPageNameKey
|
||||
} from '@renderer/store/settings'
|
||||
import { Button, Switch, Tooltip } from 'antd'
|
||||
import { Button, Space, Switch, Tooltip } from 'antd'
|
||||
import Input from 'antd/es/input/Input'
|
||||
import { FC } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
@ -121,15 +121,16 @@ const NotionSettings: FC = () => {
|
||||
<SettingRow>
|
||||
<SettingRowTitle>{t('settings.data.notion.api_key')}</SettingRowTitle>
|
||||
<HStack alignItems="center" gap="5px" style={{ width: 315 }}>
|
||||
<Input
|
||||
type="password"
|
||||
value={notionApiKey || ''}
|
||||
onChange={handleNotionTokenChange}
|
||||
onBlur={handleNotionTokenChange}
|
||||
style={{ width: 250 }}
|
||||
placeholder={t('settings.data.notion.api_key_placeholder')}
|
||||
/>
|
||||
<Button onClick={handleNotionConnectionCheck}>{t('settings.data.notion.check.button')}</Button>
|
||||
<Space.Compact style={{ width: '100%' }}>
|
||||
<Input
|
||||
type="password"
|
||||
value={notionApiKey || ''}
|
||||
onChange={handleNotionTokenChange}
|
||||
onBlur={handleNotionTokenChange}
|
||||
placeholder={t('settings.data.notion.api_key_placeholder')}
|
||||
/>
|
||||
<Button onClick={handleNotionConnectionCheck}>{t('settings.data.notion.check.button')}</Button>
|
||||
</Space.Compact>
|
||||
</HStack>
|
||||
</SettingRow>
|
||||
<SettingDivider />
|
||||
|
||||
@ -4,7 +4,7 @@ import { useTheme } from '@renderer/context/ThemeProvider'
|
||||
import { useMinappPopup } from '@renderer/hooks/useMinappPopup'
|
||||
import { RootState, useAppDispatch } from '@renderer/store'
|
||||
import { setSiyuanApiUrl, setSiyuanBoxId, setSiyuanRootPath, setSiyuanToken } from '@renderer/store/settings'
|
||||
import { Button, Tooltip } from 'antd'
|
||||
import { Button, Space, Tooltip } from 'antd'
|
||||
import Input from 'antd/es/input/Input'
|
||||
import { FC } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
@ -108,14 +108,15 @@ const SiyuanSettings: FC = () => {
|
||||
</Tooltip>
|
||||
</SettingRowTitle>
|
||||
<HStack alignItems="center" gap="5px" style={{ width: 315 }}>
|
||||
<Input
|
||||
type="password"
|
||||
value={siyuanToken || ''}
|
||||
onChange={handleTokenChange}
|
||||
style={{ width: 250 }}
|
||||
placeholder={t('settings.data.siyuan.token_placeholder')}
|
||||
/>
|
||||
<Button onClick={handleCheckConnection}>{t('settings.data.siyuan.check.button')}</Button>
|
||||
<Space.Compact style={{ width: '100%' }}>
|
||||
<Input
|
||||
type="password"
|
||||
value={siyuanToken || ''}
|
||||
onChange={handleTokenChange}
|
||||
placeholder={t('settings.data.siyuan.token_placeholder')}
|
||||
/>
|
||||
<Button onClick={handleCheckConnection}>{t('settings.data.siyuan.check.button')}</Button>
|
||||
</Space.Compact>
|
||||
</HStack>
|
||||
</SettingRow>
|
||||
<SettingDivider />
|
||||
|
||||
@ -4,7 +4,7 @@ import { useTheme } from '@renderer/context/ThemeProvider'
|
||||
import { useMinappPopup } from '@renderer/hooks/useMinappPopup'
|
||||
import { RootState, useAppDispatch } from '@renderer/store'
|
||||
import { setYuqueRepoId, setYuqueToken, setYuqueUrl } from '@renderer/store/settings'
|
||||
import { Button, Tooltip } from 'antd'
|
||||
import { Button, Space, Tooltip } from 'antd'
|
||||
import Input from 'antd/es/input/Input'
|
||||
import { FC } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
@ -100,14 +100,15 @@ const YuqueSettings: FC = () => {
|
||||
</Tooltip>
|
||||
</SettingRowTitle>
|
||||
<HStack alignItems="center" gap="5px" style={{ width: 315 }}>
|
||||
<Input
|
||||
type="password"
|
||||
value={yuqueToken || ''}
|
||||
onChange={handleYuqueTokenChange}
|
||||
style={{ width: 250 }}
|
||||
placeholder={t('settings.data.yuque.token_placeholder')}
|
||||
/>
|
||||
<Button onClick={handleYuqueConnectionCheck}>{t('settings.data.yuque.check.button')}</Button>
|
||||
<Space.Compact style={{ width: '100%' }}>
|
||||
<Input
|
||||
type="password"
|
||||
value={yuqueToken || ''}
|
||||
onChange={handleYuqueTokenChange}
|
||||
placeholder={t('settings.data.yuque.token_placeholder')}
|
||||
/>
|
||||
<Button onClick={handleYuqueConnectionCheck}>{t('settings.data.yuque.check.button')}</Button>
|
||||
</Space.Compact>
|
||||
</HStack>
|
||||
</SettingRow>
|
||||
</SettingGroup>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user