mirror of
https://github.com/wassname/talk.git
synced 2026-07-15 11:26:58 +08:00
Adds errors on field when not validated.
This commit is contained in:
@@ -28,6 +28,7 @@ const CreateDisplayNameDialog = ({open, handleClose, offset, formData, handleSub
|
||||
<p>{lang.t('createdisplay.yourusername')}</p>
|
||||
{ props.auth.error && <Alert>{props.auth.error}</Alert> }
|
||||
<form id="saveDisplayName" onSubmit={handleSubmitDisplayName}>
|
||||
{ props.errors.displayName && <span className={styles.hint}> {lang.t('createdisplay.specialCharacters')} </span> }
|
||||
<FormField
|
||||
id="displayName"
|
||||
type="string"
|
||||
|
||||
@@ -38,12 +38,6 @@ class ChangeDisplayNameContainer extends Component {
|
||||
|
||||
componentDidMount() {
|
||||
window.authCallback = this.props.facebookCallback;
|
||||
const {formData} = this.state;
|
||||
const errors = Object.keys(formData).reduce((map, prop) => {
|
||||
map[prop] = lang.t('createdisplay.requiredField');
|
||||
return map;
|
||||
}, {});
|
||||
this.setState({errors});
|
||||
}
|
||||
|
||||
handleChange(e) {
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
"save": "Save",
|
||||
"requiredField": "Required field",
|
||||
"errorCreate": "Error when changing display name",
|
||||
"checkTheForm": "Invalid Form. Please, check the fields"
|
||||
"checkTheForm": "Invalid Form. Please, check the fields",
|
||||
"specialCharacters": "Display names can contain letters, numbers and _ only"
|
||||
},
|
||||
"error": {
|
||||
"emailNotVerified": "Email address {0} not verified.",
|
||||
@@ -42,7 +43,9 @@
|
||||
"displayName": "Nombre a mostrar",
|
||||
"save": "Guardar",
|
||||
"requiredField": "Campo necesario",
|
||||
"checkTheForm": "Formulario Invalido. Por favor, verifica los campos"
|
||||
"errorCreate": "Hubo un error al cambiar el nombre de usuario",
|
||||
"checkTheForm": "Formulario Invalido. Por favor, verifica los campos",
|
||||
"specialCharacters": "Sólo pueden contener letras, números y _"
|
||||
},
|
||||
"error": {
|
||||
"emailNotVerified": "Dirección de correo electrónico {0} no verificada.",
|
||||
|
||||
Reference in New Issue
Block a user