use draggable dialog

This commit is contained in:
GotPPay
2018-05-28 16:21:12 +02:00
parent 6c0abf2a70
commit d1d5cacddb

View File

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