generated from hackforla/.github-hackforla-base-repo-template
-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into 1703-implement-shared-snapshot-view
- Loading branch information
Showing
9 changed files
with
465 additions
and
322 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,82 @@ | ||
import React from "react"; | ||
import PropTypes from "prop-types"; | ||
import ModalDialog from "../UI/AriaModal/ModalDialog"; | ||
import Button from "../Button/Button"; | ||
import { createUseStyles } from "react-jss"; | ||
import { MdWarning } from "react-icons/md"; | ||
|
||
const useStyles = createUseStyles({ | ||
title: { | ||
textAlign: "center" | ||
}, | ||
warningWrapper: { | ||
color: "#B64E38", | ||
display: "flex", | ||
alignItems: "center", | ||
justifyContent: "center" | ||
}, | ||
warningMessage: { | ||
verticalAlign: "middle", | ||
display: "flex", | ||
alignItems: "center", | ||
justifyContent: "center", | ||
marginBottom: "1em" | ||
}, | ||
modalActions: { | ||
display: "flex", | ||
justifyContent: "center" | ||
}, | ||
proceedButton: { | ||
color: "white", | ||
fontWeight: "bold" | ||
} | ||
}); | ||
|
||
const FaqConfirmDialog = ({ blocker }) => { | ||
const classes = useStyles(); | ||
return ( | ||
<ModalDialog | ||
mounted={blocker.state === "blocked"} | ||
onClose={blocker.reset} | ||
showCloseBox={false} | ||
> | ||
<div className={classes.warningWrapper}> | ||
<MdWarning alt="Warning" size={70} /> | ||
</div> | ||
<h2 className={classes.title}> | ||
<strong>Unsaved changes will be lost</strong> | ||
</h2> | ||
<p className={classes.warningMessage}> | ||
<span> | ||
Leaving this page will permanently delete any unsaved changes | ||
to the FAQ. | ||
</span> | ||
</p> | ||
<div className={classes.modalActions}> | ||
<Button | ||
color="colorCancel" | ||
variant="outlined" | ||
id="modalCancel" | ||
data-testid="transitionCancel" | ||
onClick={() => blocker.reset()} | ||
> | ||
<p style={{ fontWeight: "bold" }}>Cancel</p> | ||
</Button> | ||
<Button | ||
color="colorError" | ||
id="modalProceed" | ||
data-testid="transitionProceed" | ||
onClick={() => blocker.proceed()} | ||
> | ||
<p className={classes.proceedButton}>Proceed</p> | ||
</Button> | ||
</div> | ||
</ModalDialog> | ||
); | ||
}; | ||
|
||
FaqConfirmDialog.propTypes = { | ||
blocker: PropTypes.object.isRequired | ||
}; | ||
|
||
export default FaqConfirmDialog; |
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
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
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
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
Oops, something went wrong.