Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1915 filter reset button style #1975

Merged
merged 4 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions client/src/components/Button/TertiaryButton.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import React from "react";
import PropTypes from "prop-types";
import Button from "./Button";
import { MdPrint } from "react-icons/md";

const TertiaryButton = ({ id, onClick, isDisabled, isDisplayed, children }) => {
return (
<Button
type="input"
color={"colorDisabled"}
variant="download"
onClick={onClick}
id={id}
data-testid={id}
disabled={isDisabled}
isDisplayed={isDisplayed}
>
<MdPrint style={{ marginRight: "0.5em" }} />
{children}
</Button>
);
};

TertiaryButton.propTypes = {
children: PropTypes.object,
onClick: PropTypes.func,
id: PropTypes.string.isRequired,
isDisabled: PropTypes.bool,
isDisplayed: PropTypes.bool.isRequired
};

export default TertiaryButton;
10 changes: 7 additions & 3 deletions client/src/components/Projects/CsvModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,11 @@ const CsvModal = ({
</Button>

{(project || projectCollection) && !loading && !csvData && (
<Button onClick={handleGenerateButton} variant="error">
<Button
onClick={handleGenerateButton}
variant="contained"
color={"colorPrimary"}
>
Generate File
</Button>
)}
Expand All @@ -174,8 +178,8 @@ const CsvModal = ({
<CSVLink
data={csvData}
style={{
backgroundColor: "green",
color: "black",
backgroundColor: theme.colorPrimary,
color: theme.colors.primary.black,
textDecoration: "none",
height: "1.4rem",
fontFamily: "Calibri",
Expand Down
7 changes: 0 additions & 7 deletions client/src/components/Projects/DownloadProjectModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,6 @@ export default function DownloadProjectModal({
<Button onClick={onClose} variant="outlined">
Close
</Button>
{/* <Button
onClick={() => onClose("ok")}
variant="contained"
color={"colorPrimary"}
>
Create a Copy
</Button> */}
</div>
</ModalDialog>
);
Expand Down
5 changes: 3 additions & 2 deletions client/src/components/Projects/ProjectsPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import MultiProjectToolbarMenu from "./MultiProjectToolbarMenu";
import fetchEngineRules from "./fetchEngineRules";
import UniversalSelect from "../UI/UniversalSelect";
import ProjectTableColumnHeader from "./ColumnHeaderPopups/ProjectTableColumnHeader";
import TertiaryButton from "../Button/TertiaryButton";

const useStyles = createUseStyles({
outerDiv: {
Expand Down Expand Up @@ -941,12 +942,12 @@ const ProjectsPage = ({ contentContainerRef }) => {
<MdOutlineSearch className={classes.searchIcon} />
</div>
<div>
<button
<TertiaryButton
onClick={resetFiltersSort}
style={{ height: "40px" }}
>
RESET FILTERS/SORT
</button>
</TertiaryButton>
{/* {filterCollapsed ? (
<button
alt="Show Filter Criteria"
Expand Down
8 changes: 3 additions & 5 deletions client/src/components/Projects/RenameSnapshotModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ const useStyles = createUseStyles(theme => ({
justifyContent: "center",
margin: 0
},
heading1: theme.typography.heading1,
buttonColor: {
backgroundColor: "#eaeff2"
}
heading1: theme.typography.heading1
}));

export default function RenameSnapshotModal({
Expand Down Expand Up @@ -54,14 +51,15 @@ export default function RenameSnapshotModal({
<Button
className={classes.buttonColor}
onClick={onClose}
variant="contained"
variant="outlined"
>
Cancel
</Button>
<Button
className={classes.buttonColor}
onClick={() => onClose("ok", snapshotProjectName)}
variant="contained"
color={"colorPrimary"}
>
Done
</Button>
Expand Down
11 changes: 5 additions & 6 deletions client/src/components/Projects/ShareSnapshotModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import PropTypes from "prop-types";
import { createUseStyles, useTheme } from "react-jss";
import Button from "../Button/Button";
import ModalDialog from "../UI/AriaModal/ModalDialog";
import clsx from "clsx";
import * as projectShareService from "../../services/projectShare.service";

const useStyles = createUseStyles(theme => ({
Expand All @@ -14,9 +13,6 @@ const useStyles = createUseStyles(theme => ({
},
heading1: theme.typography.heading1,
heading2: theme.typography.heading2,
buttonColor: {
backgroundColor: theme.colors.secondary.lightGray
},
buttonDisabled: {
cursor: "default"
},
Expand Down Expand Up @@ -216,12 +212,13 @@ If you don't already have a [TDM Calculator](${tdmLink}) account, please set one
style={{ justifyContent: "right" }}
>
<Button
className={clsx(classes.buttonColor, maybeDisabled)}
className={maybeDisabled}
onClick={() => {
setPage(2);
}}
disabled={sharedEmails.length ? false : true}
variant="contained"
color={"colorPrimary"}
>
Next
</Button>
Expand Down Expand Up @@ -308,11 +305,11 @@ If you don't already have a [TDM Calculator](${tdmLink}) account, please set one
}}
>
<Button
className={classes.buttonColor}
onClick={() => {
setPage(1);
setIsCopied(false);
}}
variant="outlined"
>
Back
</Button>
Expand Down Expand Up @@ -363,6 +360,7 @@ If you don't already have a [TDM Calculator](${tdmLink}) account, please set one
setPage(1);
setSelectedEmail("");
}}
variant="outlined"
>
Cancel
</Button>
Expand All @@ -374,6 +372,7 @@ If you don't already have a [TDM Calculator](${tdmLink}) account, please set one
setSelectedEmail("");
}}
variant="contained"
color={"colorPrimary"}
>
Yes
</Button>
Expand Down
Loading