From 51644140c37e6d643c8736ee49a2e12e6495681c Mon Sep 17 00:00:00 2001 From: Roslyn Wythe Date: Mon, 16 Dec 2024 01:24:36 -0800 Subject: [PATCH] placing the warning modal in a separate component and module --- .../components/UI/AriaModal/WarningModal.jsx | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 client/src/components/UI/AriaModal/WarningModal.jsx diff --git a/client/src/components/UI/AriaModal/WarningModal.jsx b/client/src/components/UI/AriaModal/WarningModal.jsx new file mode 100644 index 00000000..ee4cd0f5 --- /dev/null +++ b/client/src/components/UI/AriaModal/WarningModal.jsx @@ -0,0 +1,99 @@ +import React from "react"; +import { PropTypes } from "prop-types"; +import Button from "../../Button/Button"; +import { createUseStyles } from "react-jss"; +import { MdWarning } from "react-icons/md"; +import ModalDialog from "./ModalDialog"; + +const useStyles = createUseStyles(theme => ({ + buttonFlexBox: { + display: "flex", + flexDirection: "row", + justifyContent: "center", + margin: 0 + }, + heading1: theme.typography.heading1, + instruction: { + fontSize: "20px", + lineHeight: "32px", + textAlign: "center", + color: "#B64E38", + "& span": { + fontStyle: "italic" + } + }, + warningWrapper: { + color: "#B64E38", + display: "flex", + alignItems: "center" + }, + warningMessage: { + verticalAlign: "middle" + }, + modalActions: { + display: "flex", + justifyContent: "center" + }, + warningIcon: { + margin: "0 10px" + }, + modalSubHeader: theme.typography.subHeading, + modalContent: { + display: "flex", + flexDirection: "column", + alignItems: "center", + justifyContent: "center", + padding: "1rem", + width: "100%", + maxWidth: "500px" + } +})); + +const WarningModal = ({ + mounted, + handleDoNotDiscard, + handleConfirmDiscard +}) => { + const classes = useStyles(); + + +

+ You have unsaved changes +

+
+

+ + + Are you sure you want to continue without saving? + +

+
+ + +
+
; +}; + +WarningModal.prototypes = { + mounted: PropTypes.bool, + onClose: PropTypes.func, + project: PropTypes.any +}; + +export default WarningModal;