后端: - 新增 WalletType 枚举(MAGIC/SAFE),移除 safe/magic 字符串硬编码 - RelayClientService/BlockchainService/AccountService/OrderSigningService 使用枚举 - Builder Relayer API 类型使用常量 RELAYER_TYPE_PROXY/SAFE 前端: - 账户列表、详情、导入 Modal 显示账号类型(Magic/Safe Tag) - 导入账户 Modal 移除安全提示 Alert,移除 showAlert 与相关 i18n - 移除无用 i18n key:securityTip、securityTipDesc、walletTypeMagic、walletTypeSafe、magicNotSupported - 钱包类型 Tag 简化为仅显示 Magic 或 Safe Co-authored-by: Cursor <cursoragent@cursor.com>
46 lines
1.2 KiB
TypeScript
46 lines
1.2 KiB
TypeScript
import { useNavigate } from 'react-router-dom'
|
|
import { Card, Form, Button, Typography } from 'antd'
|
|
import { ArrowLeftOutlined } from '@ant-design/icons'
|
|
import { useTranslation } from 'react-i18next'
|
|
import { message } from 'antd'
|
|
import AccountImportForm from '../components/AccountImportForm'
|
|
|
|
const { Title } = Typography
|
|
|
|
const AccountImport: React.FC = () => {
|
|
const { t } = useTranslation()
|
|
const navigate = useNavigate()
|
|
const [form] = Form.useForm()
|
|
|
|
const handleSuccess = async () => {
|
|
message.success(t('accountImport.importSuccess'))
|
|
navigate('/accounts')
|
|
}
|
|
|
|
return (
|
|
<div>
|
|
<div style={{ marginBottom: '16px' }}>
|
|
<Button
|
|
icon={<ArrowLeftOutlined />}
|
|
onClick={() => navigate('/accounts')}
|
|
style={{ marginBottom: '16px' }}
|
|
>
|
|
{t('accountImport.back')}
|
|
</Button>
|
|
<Title level={2} style={{ margin: 0 }}>{t('accountImport.title')}</Title>
|
|
</div>
|
|
|
|
<Card>
|
|
<AccountImportForm
|
|
form={form}
|
|
onSuccess={handleSuccess}
|
|
onCancel={() => navigate('/accounts')}
|
|
/>
|
|
</Card>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default AccountImport
|
|
|