Skip to content

Commit

Permalink
changed the button's variant to primary when the filter is active
Browse files Browse the repository at this point in the history
  • Loading branch information
shramanpaul committed Jan 18, 2024
1 parent 1b56413 commit 9db2cd8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
1 change: 0 additions & 1 deletion public/images/icons/icons8-tick.svg

This file was deleted.

31 changes: 17 additions & 14 deletions src/Components/Facility/Consultations/DailyRoundsFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { Fragment } from "react";
import { SelectFormField } from "../../Form/FormFields/SelectFormField";
import TextFormField from "../../Form/FormFields/TextFormField";
import CareIcon from "../../../CAREUI/icons/CareIcon";
import FilterIcon from "../../../../public/images/icons/icons8-tick.svg";
import dayjs from "dayjs";
import { useState } from "react";
import { useTranslation } from "react-i18next";
Expand Down Expand Up @@ -42,19 +41,23 @@ export default function DailyRoundsFilter(props: Props) {
<div className="flex flex-row-reverse items-center gap-4 md:flex-row">
<Popover className="relative ">
<Popover.Button>
<ButtonV2 variant="secondary" className="mr-5 border">
<CareIcon className="care-l-filter" />

{filter == undefined ||
filter == null ||
countDefinedProperties(filter) == 0 ? (
t("filter")
) : (
<div>
<img src={FilterIcon} alt="Filter Icon" />
</div>
)}
</ButtonV2>
{filter == undefined ||
filter == null ||
countDefinedProperties(filter) == 0 ? (
<>
<ButtonV2 variant="secondary" className="mr-5 border">
<CareIcon className="care-l-filter" />
{t("filter")}
</ButtonV2>
</>
) : (
<>
<ButtonV2 variant="primary" className="mr-5 border">
<CareIcon className="care-l-filter" />
{t("filter")}
</ButtonV2>
</>
)}
</Popover.Button>
<Transition
as={Fragment}
Expand Down

0 comments on commit 9db2cd8

Please sign in to comment.