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

Fix clear button for CNS location filter #6581

Merged
merged 3 commits into from
Nov 10, 2023
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
18 changes: 6 additions & 12 deletions src/Components/Facility/CentralNursingStation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,28 +168,22 @@ export default function CentralNursingStation({ facilityId }: Props) {
<FieldLabel className="text-sm">
Filter by Location
</FieldLabel>
<div className="flex w-full items-center gap-2">
<div>
<LocationSelect
key={qParams.location}
name="Facilities"
setSelected={(location) => updateQuery({ location })}
setSelected={(location) => {
location
? updateQuery({ location })
: removeFilter("location");
}}
selected={qParams.location}
showAll={false}
multiple={false}
facilityId={facilityId}
errors=""
errorClassName="hidden"
/>
{qParams.location && (
<ButtonV2
variant="secondary"
circle
border
onClick={() => removeFilter("location")}
>
Clear
</ButtonV2>
)}
</div>
</div>
<SelectFormField
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Facility/FacilityCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export const FacilityCard = (props: { facility: any; userType: any }) => {
: "button-primary-border bg-primary-100"
}`}
>
<span className="tooltip-text tooltip-bottom md:tooltip-right -translate-y-2">
<span className="tooltip-text tooltip-top">
Live Patients / Total beds
</span>{" "}
<CareIcon
Expand Down
18 changes: 6 additions & 12 deletions src/Components/Facility/LiveFeedScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,28 +137,22 @@ export default function LiveFeedScreen({ facilityId }: Props) {
<FieldLabel className="text-sm">
Filter by Location
</FieldLabel>
<div className="flex w-full items-center gap-2">
<div>
<LocationSelect
key={qParams.location}
name="Facilities"
setSelected={(location) => updateQuery({ location })}
setSelected={(location) => {
location
? updateQuery({ location })
: removeFilter("location");
}}
selected={qParams.location}
showAll={false}
multiple={false}
facilityId={facilityId}
errors=""
errorClassName="hidden"
/>
{qParams.location && (
<ButtonV2
variant="secondary"
circle
border
onClick={() => removeFilter("location")}
>
Clear
</ButtonV2>
)}
</div>
</div>
<CheckBoxFormField
Expand Down
Loading