use draggable dialog
This commit is contained in:
@@ -28,30 +28,39 @@ export class ValidationErrorsInfoDialog extends React.Component {
|
||||
|
||||
render() {
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Dialog
|
||||
title="Errors"
|
||||
actions={actions}
|
||||
modal={this.props.modal ? this.props.modal : false}
|
||||
open={this.state.open}
|
||||
onRequestClose={this.handleClose}
|
||||
overlayStyle={{ backgroundColor: 'transparent' }}
|
||||
>
|
||||
{this.props.errorMessages.map(errorMessage => {
|
||||
const oneValidationMessage = (<span><a>{errorMessage.message}</a><br /></span>);
|
||||
const oneValidationMessageWithTab = (<span><li style={{ marginLeft: 2 + "em" }}>{errorMessage.message}</li></span>);
|
||||
|
||||
if (errorMessage.field_name === "password-tab") {
|
||||
return oneValidationMessageWithTab;
|
||||
} else {
|
||||
return oneValidationMessage;
|
||||
const actions = [
|
||||
<FlatButton
|
||||
label="Dismiss"
|
||||
primary={true}
|
||||
onClick={this.handleClose}
|
||||
/>,
|
||||
];
|
||||
|
||||
return (
|
||||
<div className="container">
|
||||
{
|
||||
this.state.open &&
|
||||
<Dialog
|
||||
title={this.props.title ? this.props.title : 'Error'}
|
||||
isDraggable={this.props.draggable ? this.props.draggable : false}
|
||||
buttons={actions}
|
||||
hasCloseIcon={false}
|
||||
modal={this.props.modal ? this.props.modal : false}
|
||||
height={defaultDialogHeight + this.props.errorMessages.length * dialogHeightPerLine}
|
||||
>
|
||||
{this.props.errorMessages.map(errorMessage => {
|
||||
return (
|
||||
<div>
|
||||
<a>{errorMessage.message}</a>
|
||||
<br/>
|
||||
</div>
|
||||
);})
|
||||
}
|
||||
</Dialog>
|
||||
}
|
||||
})}
|
||||
</Dialog>
|
||||
</div>
|
||||
);
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = ValidationErrorsInfoDialog;
|
||||
module.exports = ValidationErrorsInfoDialog;
|
||||
|
||||
Reference in New Issue
Block a user