generated from hackforla/.github-hackforla-base-repo-template
-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
439 additions
and
336 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import React from "react"; | ||
import PropTypes from "prop-types"; | ||
import Button from "./Button"; | ||
|
||
const SecondaryButton = ({ | ||
id, | ||
onClick, | ||
isDisabled, | ||
isDisplayed = false, | ||
children | ||
}) => { | ||
return ( | ||
<Button | ||
type="input" | ||
onClick={onClick} | ||
id={id} | ||
data-testid={id} | ||
disabled={isDisabled} | ||
isDisplayed={isDisplayed} | ||
> | ||
{children} | ||
</Button> | ||
); | ||
}; | ||
|
||
SecondaryButton.propTypes = { | ||
children: PropTypes.any, | ||
onClick: PropTypes.func, | ||
id: PropTypes.string, | ||
isDisabled: PropTypes.bool, | ||
isDisplayed: PropTypes.bool | ||
}; | ||
|
||
export default SecondaryButton; |
This file was deleted.
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
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,66 @@ | ||
import React from "react"; | ||
import PropTypes from "prop-types"; | ||
import ModalDialog from "../UI/AriaModal/ModalDialog"; | ||
import Button from "../Button/Button"; | ||
import { MdWarning } from "react-icons/md"; | ||
import { createUseStyles, useTheme } from "react-jss"; | ||
|
||
const useStyles = createUseStyles(theme => ({ | ||
container: { | ||
display: "flex", | ||
flexDirection: "column", | ||
alignItems: "center" | ||
}, | ||
warningIcon: { | ||
height: "80px", | ||
width: "80px", | ||
color: theme.colorCritical, | ||
textAlign: "center" | ||
}, | ||
buttonFlexBox: { | ||
display: "flex", | ||
flexDirection: "row", | ||
justifyContent: "center", | ||
margin: 0 | ||
}, | ||
modalHeader: theme.typography.heading1, | ||
modalSubHeader: { | ||
...theme.typography.subHeading, | ||
marginTop: "1rem", | ||
marginBottom: "1rem" | ||
} | ||
})); | ||
|
||
const DeleteFaqModal = ({ isModalOpen, closeModal, handleDelete, isFaq }) => { | ||
const theme = useTheme(); | ||
const classes = useStyles(theme); | ||
const type = isFaq ? "FAQ" : "Category"; | ||
return ( | ||
<ModalDialog mounted={isModalOpen} onClose={closeModal} omitCloseBox={true}> | ||
<div className={classes.container}> | ||
<MdWarning alt="Warning" className={classes.warningIcon} /> | ||
<div className={classes.modalHeader}>{` Delete ${type}`}</div> | ||
<div className={classes.modalSubHeader}> | ||
{`Are you sure you want to permanently delete the ${type}?`} | ||
</div> | ||
<div className={classes.buttonFlexBox}> | ||
<Button onClick={closeModal} variant="secondary" id="cancelButton"> | ||
Cancel | ||
</Button> | ||
<Button onClick={handleDelete} variant="warning"> | ||
Delete | ||
</Button> | ||
</div> | ||
</div> | ||
</ModalDialog> | ||
); | ||
}; | ||
|
||
DeleteFaqModal.propTypes = { | ||
isModalOpen: PropTypes.bool, | ||
closeModal: PropTypes.func, | ||
handleDelete: PropTypes.func, | ||
isFaq: PropTypes.bool | ||
}; | ||
|
||
export default DeleteFaqModal; |
Oops, something went wrong.