style: add centered prop to modals and components for improved layout consistency

This commit is contained in:
kangfenmao 2025-05-10 22:21:37 +08:00
parent b80b63e207
commit 47d0a3cc0d
9 changed files with 16 additions and 8 deletions

View File

@ -254,6 +254,7 @@ export function WebdavBackupManager({ visible, onClose, webdavConfig, restoreMet
open={visible}
onCancel={onClose}
width={800}
centered
footer={[
<Button key="refresh" icon={<ReloadOutlined />} onClick={fetchBackupFiles} disabled={loading}>
{t('settings.data.webdav.backup.manager.refresh')}

View File

@ -76,7 +76,8 @@ export function WebdavBackupModal({
open={isModalVisible}
onOk={handleBackup}
onCancel={handleCancel}
okButtonProps={{ loading: backuping }}>
okButtonProps={{ loading: backuping }}
centered>
<Input
value={customFileName}
onChange={(e) => setCustomFileName(e.target.value)}
@ -206,7 +207,8 @@ export function WebdavRestoreModal({
onOk={handleRestore}
onCancel={handleCancel}
okButtonProps={{ loading: restoring }}
width={600}>
width={600}
centered>
<div style={{ position: 'relative' }}>
<Select
style={{ width: '100%' }}

View File

@ -179,7 +179,8 @@ const App: FC<Props> = ({ app, onClick, size = 60, isLast }) => {
setIsModalVisible(false)
setFileList([])
}}
footer={null}>
footer={null}
centered>
<Form form={form} onFinish={handleAddCustomApp} layout="vertical">
<Form.Item
name="id"

View File

@ -162,7 +162,8 @@ const QuickPhrasesButton = ({ ref, setInputValue, resizeTextArea, ToolbarButton,
setIsModalOpen(false)
setFormData({ title: '', content: '', location: 'global' })
}}
width={520}>
width={520}
centered>
<Space direction="vertical" style={{ width: '100%' }} size="middle">
<div>
<Label>{t('settings.quickPhrase.titleLabel')}</Label>

View File

@ -43,6 +43,7 @@ const Mermaid: React.FC<Props> = ({ chart }) => {
useEffect(() => {
setTimeout(renderMermaidBase, 0)
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [])
useEffect(() => {

View File

@ -347,7 +347,7 @@ const MessageMenubar: FC<Props> = (props) => {
].filter(Boolean)
}
],
[message, messageContainerRef, onEdit, mainTextContent, onNewBranch, t, topic.name, exportMenuOptions]
[message, messageContainerRef, isEditable, onEdit, mainTextContent, onNewBranch, t, topic.name, exportMenuOptions]
)
const onRegenerate = async (e: React.MouseEvent | undefined) => {

View File

@ -37,8 +37,8 @@ import {
setPasteLongTextThreshold,
setRenderInputMessageAsMarkdown,
setShowInputEstimatedTokens,
setShowPrompt,
setShowMessageDivider,
setShowPrompt,
setShowTranslateConfirm,
setThoughtAutoCollapse
} from '@renderer/store/settings'

View File

@ -135,7 +135,8 @@ const AssistantRegularPromptsSettings: FC<AssistantRegularPromptsSettingsProps>
open={isModalOpen}
onOk={handleModalOk}
onCancel={() => setIsModalOpen(false)}
width={520}>
width={520}
centered>
<Space direction="vertical" style={{ width: '100%' }} size="middle">
<div>
<Label>{t('assistants.settings.regular_phrases.titleLabel', 'Title')}</Label>

View File

@ -117,7 +117,8 @@ const QuickPhraseSettings: FC = () => {
open={isModalOpen}
onOk={handleModalOk}
onCancel={() => setIsModalOpen(false)}
width={520}>
width={520}
centered>
<Space direction="vertical" style={{ width: '100%' }} size="middle">
<div>
<Label>{t('settings.quickPhrase.titleLabel')}</Label>