mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-22 08:40:08 +08:00
fix: align and unify LocalBackupManager footer layout (#10985)
* fix: align and unify LocalBackupManager footer layout - Use Space component to wrap footer buttons, consistent with S3BackupManager - Optimize delete button i18n text by using count parameter instead of hardcoded concatenation * fix: fix the i18n issue in the delete button text
This commit is contained in:
parent
7bcae6fba2
commit
c7ceb3035d
@ -1,7 +1,7 @@
|
|||||||
import { DeleteOutlined, ExclamationCircleOutlined, ReloadOutlined } from '@ant-design/icons'
|
import { DeleteOutlined, ExclamationCircleOutlined, ReloadOutlined } from '@ant-design/icons'
|
||||||
import { restoreFromLocal } from '@renderer/services/BackupService'
|
import { restoreFromLocal } from '@renderer/services/BackupService'
|
||||||
import { formatFileSize } from '@renderer/utils'
|
import { formatFileSize } from '@renderer/utils'
|
||||||
import { Button, message, Modal, Table, Tooltip } from 'antd'
|
import { Button, message, Modal, Space, Table, Tooltip } from 'antd'
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
import { useCallback, useEffect, useState } from 'react'
|
import { useCallback, useEffect, useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
@ -214,18 +214,11 @@ export function LocalBackupManager({ visible, onClose, localBackupDir, restoreMe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
const footerContent = (
|
||||||
<Modal
|
<Space align="center">
|
||||||
title={t('settings.data.local.backup.manager.title')}
|
|
||||||
open={visible}
|
|
||||||
onCancel={onClose}
|
|
||||||
width={800}
|
|
||||||
centered
|
|
||||||
transitionName="animation-move-down"
|
|
||||||
footer={[
|
|
||||||
<Button key="refresh" icon={<ReloadOutlined />} onClick={fetchBackupFiles} disabled={loading}>
|
<Button key="refresh" icon={<ReloadOutlined />} onClick={fetchBackupFiles} disabled={loading}>
|
||||||
{t('settings.data.local.backup.manager.refresh')}
|
{t('settings.data.local.backup.manager.refresh')}
|
||||||
</Button>,
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
key="delete"
|
key="delete"
|
||||||
danger
|
danger
|
||||||
@ -234,11 +227,22 @@ export function LocalBackupManager({ visible, onClose, localBackupDir, restoreMe
|
|||||||
disabled={selectedRowKeys.length === 0 || deleting}
|
disabled={selectedRowKeys.length === 0 || deleting}
|
||||||
loading={deleting}>
|
loading={deleting}>
|
||||||
{t('settings.data.local.backup.manager.delete.selected')} ({selectedRowKeys.length})
|
{t('settings.data.local.backup.manager.delete.selected')} ({selectedRowKeys.length})
|
||||||
</Button>,
|
</Button>
|
||||||
<Button key="close" onClick={onClose}>
|
<Button key="close" onClick={onClose}>
|
||||||
{t('common.close')}
|
{t('common.close')}
|
||||||
</Button>
|
</Button>
|
||||||
]}>
|
</Space>
|
||||||
|
)
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Modal
|
||||||
|
title={t('settings.data.local.backup.manager.title')}
|
||||||
|
open={visible}
|
||||||
|
onCancel={onClose}
|
||||||
|
width={800}
|
||||||
|
centered
|
||||||
|
transitionName="animation-move-down"
|
||||||
|
footer={footerContent}>
|
||||||
<Table
|
<Table
|
||||||
rowKey="fileName"
|
rowKey="fileName"
|
||||||
columns={columns}
|
columns={columns}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user