-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ui: form builder delete modal propery refactor
* closes cernanalysispreservation#1950 Signed-off-by: papadopan <[email protected]>
- Loading branch information
Showing
2 changed files
with
53 additions
and
44 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
...ap-react/src/components/cms/components/SchemaWizard/PropertyEditor/DeletePropertyModal.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import React from "react"; | ||
import PropTypes from "prop-types"; | ||
import Modal from "../../../../partials/Modal"; | ||
import Button from "../../../../partials/Button"; | ||
import Box from "grommet/components/Box"; | ||
import Paragraph from "grommet/components/Paragraph"; | ||
|
||
const DeletePropertyModal = ({ show, text, onClose, onDelete }) => { | ||
return ( | ||
show && ( | ||
<Modal title="Delete Item" separator onClose={onClose}> | ||
<Box pad={{ vertical: "medium", horizontal: "small" }}> | ||
<Box align="center" justify="center" colorIndex="light-1"> | ||
<Paragraph margin="none">Are you sure you want to delete</Paragraph> | ||
<Paragraph margin="none">{text}</Paragraph> | ||
</Box> | ||
|
||
<Box margin={{ top: "medium" }} direction="row" justify="between"> | ||
<Button text="Cancel" secondary onClick={onClose} /> | ||
<Button text="Delete" critical onClick={onDelete} /> | ||
</Box> | ||
</Box> | ||
</Modal> | ||
) | ||
); | ||
}; | ||
|
||
DeletePropertyModal.propTypes = { | ||
show: PropTypes.bool, | ||
text: PropTypes.string, | ||
onClose: PropTypes.func, | ||
onDelete: PropTypes.func | ||
}; | ||
|
||
export default DeletePropertyModal; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters