feat: 个人信息

This commit is contained in:
秋水浮尘
2023-11-05 23:51:21 +08:00
parent c1093fa556
commit a635d71a3c
16 changed files with 211 additions and 59 deletions

View File

@@ -0,0 +1,60 @@
import { useState } from 'react'
import { Form, Row, Col, Input, Button, Card } from 'antd'
import './index.less'
const layout = {
labelCol: { span: 4 },
wrapperCol: { span: 10, offset: 1 }
}
const UserInfo = () => {
const [editFields, setEditFields] = useState<Record<string, any>>({
nickName: false,
gender: false,
introduce: false,
birth: false
})
const changeEditFields = (field: string) => {
setEditFields({
...editFields,
[field]: !editFields[field]
})
}
return <div className='user-info-box'>
<Card title='基本信息'>
<Form {...layout} colon={false}>
<Row >
<Col span={16}>
<Form.Item label='用户昵称'>
{editFields.nickName ? <Input placeholder='请输入昵称' /> : <>
</>}
</Form.Item>
</Col>
<Col span={16}>
<Form.Item label='性&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;别'>
<Input />
</Form.Item>
</Col>
<Col span={16}>
<Form.Item label='个人简介'>
<Input />
</Form.Item>
</Col>
<Col span={16}>
<Form.Item label='出生日期'>
<Input />
</Form.Item>
</Col>
</Row>
</Form>
</Card>
</div>
}
export default UserInfo