Compare commits
1 Commits
make-error
...
self-regis
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4f872c0189 |
@@ -46,12 +46,14 @@ export class ValidationErrorsInfoDialog extends React.Component {
|
|||||||
overlayStyle={{ backgroundColor: 'transparent' }}
|
overlayStyle={{ backgroundColor: 'transparent' }}
|
||||||
>
|
>
|
||||||
{this.props.errorMessages.map(errorMessage => {
|
{this.props.errorMessages.map(errorMessage => {
|
||||||
return (
|
const oneValidationMessage = (<span><a>{errorMessage.message}</a><br /></span>);
|
||||||
<div>
|
const oneValidationMessageWithTab = (<span><li style={{ marginLeft: 2 + "em" }}>{errorMessage.message}</li></span>);
|
||||||
<a>{errorMessage.message}</a>
|
|
||||||
<br />
|
if (errorMessage.field_name === "password-tab") {
|
||||||
</div>
|
return oneValidationMessageWithTab;
|
||||||
);
|
} else {
|
||||||
|
return oneValidationMessage;
|
||||||
|
}
|
||||||
})}
|
})}
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ import Toggle from 'material-ui/Toggle';
|
|||||||
import Snackbar from 'material-ui/Snackbar';
|
import Snackbar from 'material-ui/Snackbar';
|
||||||
import Instance from '../../../components/Connection';
|
import Instance from '../../../components/Connection';
|
||||||
|
|
||||||
|
import ValidationErrorsInfoDialog from '../../../components/Shared/ValidationErrorsInfoDialog';
|
||||||
|
|
||||||
class SignUp extends React.Component {
|
class SignUp extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
@@ -144,29 +146,13 @@ class SignUp extends React.Component {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
handleDismiss() {
|
handleValidationErrosDialogDismiss() {
|
||||||
this.setState(Object.assign(this.state, { showErrorMessage: false }));
|
this.setState(Object.assign(this.state, {
|
||||||
|
showValidationErrors: false
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
let validationErrors = null;
|
|
||||||
if (this.state.showValidationErrors) {
|
|
||||||
validationErrors = (
|
|
||||||
<ul>
|
|
||||||
{this.state.validationErrors.map(errorMessage => {
|
|
||||||
const oneValidationMessage = (<li>{errorMessage.message}</li>);
|
|
||||||
const oneValidationMessageWithTab = (<span><li style={{ marginLeft: 2 + "em" }}>{errorMessage.message}</li></span>);
|
|
||||||
|
|
||||||
if (errorMessage.field_name === "password-tab") {
|
|
||||||
return oneValidationMessageWithTab;
|
|
||||||
} else {
|
|
||||||
return oneValidationMessage;
|
|
||||||
}
|
|
||||||
})}
|
|
||||||
</ul>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="body-inner">
|
<div className="body-inner">
|
||||||
|
|
||||||
@@ -245,10 +231,7 @@ class SignUp extends React.Component {
|
|||||||
<div className="form-group">
|
<div className="form-group">
|
||||||
<p className="text-small">By clicking on sign up, you agree to <a href="javascript:;"><i>terms</i></a> and <a href="javascript:;"><i>privacy policy</i></a></p>
|
<p className="text-small">By clicking on sign up, you agree to <a href="javascript:;"><i>terms</i></a> and <a href="javascript:;"><i>privacy policy</i></a></p>
|
||||||
</div>
|
</div>
|
||||||
<div className="divider" />
|
<ValidationErrorsInfoDialog open={this.state.showValidationErrors} errorMessages={this.state.validationErrors} onDismiss={this.handleValidationErrosDialogDismiss.bind(this)} />
|
||||||
<div className="form-group">
|
|
||||||
{validationErrors}
|
|
||||||
</div>
|
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user