Skip to content

Commit

Permalink
created button variant for error with white text (#1952)
Browse files Browse the repository at this point in the history
  • Loading branch information
heejung-hong authored Nov 14, 2024
1 parent 97473b4 commit 2bbd4cc
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
12 changes: 12 additions & 0 deletions client/src/components/Button/Button.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,18 @@ const useStyles = createUseStyles(theme => ({
backgroundColor: theme.colors.warning, // Solid red background on hover
boxShadow: "rgba(0, 46, 109, 0.4) 2px 4px 6px" // Heavier box shadow on hover
}
},
error: {
backgroundColor: theme.colorError,
color: "white",
borderColor: "rgba(0, 0, 0, .05)", //lightest grey
boxShadow: "rgba(0, 46, 109, 0.3) 1px 2px 3px",
"&[disabled]:hover": {
boxShadow: "rgba(0, 46, 109, 0.3) 1px 2px 3px"
},
"&:hover": {
boxShadow: "rgba(0, 46, 109, 0.6) 2px 4px 6px" // Heavier box shadow on hover
}
}
}));

Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Faq/DeleteFaqModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const DeleteFaqModal = ({ isModalOpen, closeModal, handleDelete, isFaq }) => {
<Button onClick={closeModal} variant="outlined" id="cancelButton">
Cancel
</Button>
<Button onClick={handleDelete} variant="contained" color={"colorError"}>
<Button onClick={handleDelete} variant="error">
Delete
</Button>
</div>
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/ProjectWizard/NavConfirmDialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const NavConfirmDialog = ({ blocker }) => {
Cancel
</Button>
<Button
color="colorError"
variant="error"
id="modalProceed"
data-testid="transitionProceed"
onClick={() => blocker.proceed()}
Expand Down
6 changes: 1 addition & 5 deletions client/src/components/Projects/CsvModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,7 @@ const CsvModal = ({
</Button>

{(project || projectCollection) && !loading && !csvData && (
<Button
onClick={handleGenerateButton}
variant="contained"
color={"colorError"}
>
<Button onClick={handleGenerateButton} variant="error">
Generate File
</Button>
)}
Expand Down
12 changes: 2 additions & 10 deletions client/src/components/Projects/DeleteProjectModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,11 @@ const DeleteProjectModal = ({ mounted, onClose, project }) => {
Cancel
</Button>
{project.dateTrashed ? (
<Button
onClick={() => onClose("ok")}
variant="contained"
color={"colorError"}
>
<Button onClick={() => onClose("ok")} variant="error">
Restore
</Button>
) : (
<Button
onClick={() => onClose("ok")}
variant="contained"
color={"colorError"}
>
<Button onClick={() => onClose("ok")} variant="error">
Delete
</Button>
)}
Expand Down

0 comments on commit 2bbd4cc

Please sign in to comment.