Skip to content
This repository has been archived by the owner on Jun 8, 2023. It is now read-only.

Commit

Permalink
fix: 修复用户信息补全国际化问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Xuancaosu committed Oct 8, 2021
1 parent 53af775 commit 408179b
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { UploadImage } from '../UploadImage'
import { requestClient } from '../../api/http'
import { CompleteUserInfoFormProps } from '../../types'
import { useTranslation } from 'react-i18next'
import { i18n } from '../../locales'

export const CompleteUserInfoForm: FC<CompleteUserInfoFormProps> = ({
onSuccess,
Expand Down Expand Up @@ -101,13 +102,10 @@ export const CompleteUserInfoForm: FC<CompleteUserInfoFormProps> = ({
const formFields = extendsFields.map((def) => {
const key = `${def.type} ${def.type === 'internal' ? def.name : def.id}`

const label = i18n.language === 'zh-CN' ? def.label : def.name

return (
<Form.Item
key={key}
name={key}
label={def.label}
style={{ marginBottom: 8 }}
>
<Form.Item key={key} name={key} label={label} style={{ marginBottom: 8 }}>
{INPUT_MAP[def.inputType] || (
<Input type={def.inputType} size="large" />
)}
Expand Down

0 comments on commit 408179b

Please sign in to comment.