diff --git a/src/components/Shared/ValidationErrorsInfoDialog.js b/src/components/Shared/ValidationErrorsInfoDialog.js
index f0efe0c..1b19abe 100644
--- a/src/components/Shared/ValidationErrorsInfoDialog.js
+++ b/src/components/Shared/ValidationErrorsInfoDialog.js
@@ -46,12 +46,14 @@ export class ValidationErrorsInfoDialog extends React.Component {
overlayStyle={{ backgroundColor: 'transparent' }}
>
{this.props.errorMessages.map(errorMessage => {
- return (
-
- );
+ const oneValidationMessage = ({errorMessage.message}
);
+ const oneValidationMessageWithTab = ({errorMessage.message});
+
+ if (errorMessage.field_name === "password-tab") {
+ return oneValidationMessageWithTab;
+ } else {
+ return oneValidationMessage;
+ }
})}
diff --git a/src/routes/selfRegister/components/SignUp.js b/src/routes/selfRegister/components/SignUp.js
index 020c952..de05bad 100644
--- a/src/routes/selfRegister/components/SignUp.js
+++ b/src/routes/selfRegister/components/SignUp.js
@@ -17,6 +17,8 @@ import Toggle from 'material-ui/Toggle';
import Snackbar from 'material-ui/Snackbar';
import Instance from '../../../components/Connection';
+import ValidationErrorsInfoDialog from '../../../components/Shared/ValidationErrorsInfoDialog';
+
class SignUp extends React.Component {
constructor(props) {
super(props);
@@ -144,29 +146,13 @@ class SignUp extends React.Component {
});
}
- handleDismiss() {
- this.setState(Object.assign(this.state, { showErrorMessage: false }));
+ handleValidationErrosDialogDismiss() {
+ this.setState(Object.assign(this.state, {
+ showValidationErrors: false
+ }));
}
render() {
- let validationErrors = null;
- if (this.state.showValidationErrors) {
- validationErrors = (
-
- {this.state.validationErrors.map(errorMessage => {
- const oneValidationMessage = (- {errorMessage.message}
);
- const oneValidationMessageWithTab = (- {errorMessage.message}
);
-
- if (errorMessage.field_name === "password-tab") {
- return oneValidationMessageWithTab;
- } else {
- return oneValidationMessage;
- }
- })}
-
- );
- }
-
return (
@@ -245,10 +231,7 @@ class SignUp extends React.Component {
-
-
- {validationErrors}
-
+