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() {
return ( const actions = [
<div> <FlatButton
<Dialog label="Dismiss"
title="Errors" primary={true}
actions={actions} onClick={this.handleClose}
modal={this.props.modal ? this.props.modal : false} />,
open={this.state.open} ];
onRequestClose={this.handleClose}
overlayStyle={{ backgroundColor: 'transparent' }} return (
> <div className="container">
{this.props.errorMessages.map(errorMessage => { {
const oneValidationMessage = (<span><a>{errorMessage.message}</a><br /></span>); this.state.open &&
const oneValidationMessageWithTab = (<span><li style={{ marginLeft: 2 + "em" }}>{errorMessage.message}</li></span>); <Dialog
title={this.props.title ? this.props.title : 'Error'}
if (errorMessage.field_name === "password-tab") { isDraggable={this.props.draggable ? this.props.draggable : false}
return oneValidationMessageWithTab; buttons={actions}
} else { hasCloseIcon={false}
return oneValidationMessage; 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>
} }
})} </div>
</Dialog> );
</div> }
);
} }
}
module.exports = ValidationErrorsInfoDialog; module.exports = ValidationErrorsInfoDialog;