Skip to content

Commit 1570a9b

Browse files
committed
feat: 优化联系邮箱编辑体验并展示本人注册邮箱
- 联系邮箱输入框支持清空(allowClear),并补充说明文字区分"注册邮箱" - 用户主页对本人也展示注册邮箱条目(后端权限已同步放开)
1 parent 7d59fa6 commit 1570a9b

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

public/locales/zh-CN/translations.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1624,6 +1624,7 @@
16241624
"avatar_upload_success": "头像上传成功!",
16251625
"cancel": "取消",
16261626
"change_avatar": "更换头像",
1627+
"contact_email": "联系邮箱",
16271628
"description": "个人简介",
16281629
"description_max_length": "个人简介不能超过200个字符",
16291630
"description_placeholder": "介绍一下自己吧...",
@@ -1632,6 +1633,7 @@
16321633
"email_code_required": "请先发送并填写邮箱验证码",
16331634
"email_code_resend": "重新发送",
16341635
"email_code_sent": "验证码已发送",
1636+
"email_help_text": "用于公开展示以便他人联系您,与注册邮箱不同,可留空",
16351637
"email_max_length": "邮箱地址不能超过50个字符",
16361638
"email_placeholder": "联系邮箱",
16371639
"email_send_code": "发送验证码",

src/components/UserProfile/UserEditModal.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,14 +228,20 @@ export default function UserEditModal({
228228
</Form.Item>
229229

230230
<Form.Item
231-
label="Email"
231+
label={t('contact_email')}
232232
name="email"
233233
rules={[
234234
{ type: 'email', message: t('email_validation') },
235235
{ max: 50, message: t('email_max_length') },
236236
]}
237+
extra={
238+
<Text type="secondary" className="text-xs">
239+
{t('email_help_text')}
240+
</Text>
241+
}
237242
>
238243
<Input
244+
allowClear
239245
prefix={<MailOutlined />}
240246
placeholder={t('email_placeholder')}
241247
maxLength={50}

src/components/UserProfile/UserProfileLayout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ export default function UserProfileLayout({
459459
},
460460
]
461461
: []),
462-
...(isAdmin && currentUserData.register_email
462+
...(currentUserData.register_email
463463
? [
464464
{
465465
key: 'register_email',

0 commit comments

Comments
 (0)