style(ui): polish Profile page layout and user info display

This commit is contained in:
2026-02-06 21:23:13 +08:00
parent 9c1e923336
commit e5b391f7b7

View File

@@ -1,6 +1,6 @@
import { useState, useEffect } from 'react';
import { Form, Input, Button, Card, message, Avatar, Descriptions, Space, Modal } from 'antd';
import { UserOutlined, LockOutlined } from '@ant-design/icons';
import { Form, Input, Button, Card, message, Avatar, Descriptions, Space, Modal, Row, Col } from 'antd';
import { UserOutlined, LockOutlined, SafetyOutlined } from '@ant-design/icons';
import { authApi } from '@/services/api';
import type { User } from '@/types';
@@ -60,17 +60,19 @@ function ProfilePage() {
};
return (
<div style={{ maxWidth: '800px', margin: '0 auto' }}>
<div>
<Card
title={
<span>
<UserOutlined />
</span>
}
style={{ marginBottom: '24px' }}
bordered={false}
>
<Row gutter={24}>
<Col span={12}>
{user && (
<Descriptions column={1} bordered style={{ marginBottom: '24px' }}>
<Descriptions column={1} bordered>
<Descriptions.Item label="头像">
<Avatar icon={<UserOutlined />} size={64} />
</Descriptions.Item>
@@ -83,7 +85,12 @@ function ProfilePage() {
</Descriptions.Item>
</Descriptions>
)}
</Col>
<Col span={12}>
<div style={{ marginBottom: '16px', fontSize: '16px', fontWeight: 'bold' }}>
</div>
<Form
form={profileForm}
onFinish={handleUpdateProfile}
@@ -116,20 +123,44 @@ function ProfilePage() {
</Space>
</Form.Item>
</Form>
</Card>
<div style={{ marginTop: '24px', marginBottom: '16px', fontSize: '16px', fontWeight: 'bold' }}>
</div>
<Card
title={
<span>
<LockOutlined />
</span>
}
extra={
size="small"
bordered={false}
style={{ backgroundColor: '#fafafa' }}
>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
<Space>
<LockOutlined />
<span></span>
</Space>
<Button type="primary" onClick={() => setPasswordModalVisible(true)}>
</Button>
}
/>
</div>
</Card>
<Card
size="small"
bordered={false}
style={{ marginTop: '16px', backgroundColor: '#fafafa' }}
>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
<Space>
<SafetyOutlined />
<span></span>
</Space>
<Button type="default">
</Button>
</div>
</Card>
</Col>
</Row>
</Card>
<Modal
title="修改密码"