From f4f5023fa39ed517ce6c71c5575eba134f4878de Mon Sep 17 00:00:00 2001 From: Umang darji Date: Mon, 10 Feb 2020 18:22:59 +0530 Subject: [PATCH] Back drop fix. --- src/components/ModalComponent.tsx | 67 ++++++++++++++++--------------- 1 file changed, 34 insertions(+), 33 deletions(-) diff --git a/src/components/ModalComponent.tsx b/src/components/ModalComponent.tsx index 0a8d253..3153e3d 100644 --- a/src/components/ModalComponent.tsx +++ b/src/components/ModalComponent.tsx @@ -92,7 +92,7 @@ export class ModalComponent extends React.Component { modelChanged = (value: any) => { this.setState((prevState: any) => { - return { item: Object.assign({}, prevState.item, value)} + return { item: Object.assign({}, prevState.item, value) } }) } @@ -122,63 +122,64 @@ export class ModalComponent extends React.Component { const errorClassName = this.state.error ? "error-animate" : "" return {this.props.modalType === "CREATE" && - {"+ New " + this.props.constants.creationTitle}} + {"+ New " + this.props.constants.creationTitle}} {this.props.modalType === "EDIT" && {"Edit " + this.props.constants.creationTitle + " - " + this.props.item[this.getRepField().field]}} {this.props.modalType === "FILTER" && - {"Filter " + this.props.constants.creationTitle}} + {"Filter " + this.props.constants.creationTitle}} {this.props.modalType === "CUSTOM" && - {"Custom " + this.props.constants.creationTitle + " - " + this.props.item[this.getRepField().field]}} + {"Custom " + this.props.constants.creationTitle + " - " + this.props.item[this.getRepField().field]}} this.modalBodyRef = ReactDOM.findDOMNode(reactComponent)} className="modal-height"> {this.state.error && - - { -
- {errorType && {errorType}} - {errorMessage &&
{errorMessage}
} -
- } -
+ + { +
+ {errorType && {errorType}} + {errorMessage &&
{errorMessage}
} +
+ } +
}
{this.props.deleteModel && this.props.modalType === "EDIT" && -
- Delete
} +
+ Delete
} {this.state.deleteModal && - - - {"Delete " + this.props.constants.creationTitle} - - - {"Are you sure you want to delete " + this.props.item[this.getRepField().field] + " ?"} - - -
Delete
-
Cancel
-
-
+ + + {"Delete " + this.props.constants.creationTitle} + + + {"Are you sure you want to delete " + this.props.item[this.getRepField().field] + " ?"} + + +
Delete
+
Cancel
+
+
} {this.props.modalType === "EDIT" ? <>
Update
{this.props.constants.saveAsNew && -
Save as New
} +
Save as New
} : null} {this.props.modalType === "CREATE" || this.props.modalType === "CUSTOM" ? (
{this.props.successButtonLabel || "Create"}