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 responsiveness of FacilityCard and ManagePatients components #9276

Closed
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
2 changes: 1 addition & 1 deletion src/components/Facility/FacilityCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export const FacilityCard = (props: {
href={`/facility/${facility.id}/cns`}
border
ghost
className="mt-2 sm:mt-0"
className="mt-2 sm:mt-0 md:mt-1"
>
<CareIcon
icon="l-monitor-heart-rate"
Expand Down
104 changes: 54 additions & 50 deletions src/components/Patient/ManagePatients.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -796,52 +796,54 @@
hideBack={true}
breadcrumbs={false}
options={
<div className="flex w-full flex-col items-center justify-between lg:flex-row">
<div className="mb-2 flex w-full flex-col items-center lg:mb-0 lg:w-fit lg:flex-row lg:gap-5">
<ButtonV2
id="add-patient-details"
onClick={() => {
const showAllFacilityUsers = ["DistrictAdmin", "StateAdmin"];
if (
qParams.facility &&
showAllFacilityUsers.includes(authUser.user_type)
)
navigate(`/facility/${qParams.facility}/patient`);
else if (
qParams.facility &&
!showAllFacilityUsers.includes(authUser.user_type) &&
authUser.home_facility_object?.id !== qParams.facility
)
Notification.Error({
msg: "Oops! Non-Home facility users don't have permission to perform this action.",
});
else if (
!showAllFacilityUsers.includes(authUser.user_type) &&
authUser.home_facility_object?.id
) {
navigate(
`/facility/${authUser.home_facility_object.id}/patient`,
);
} else if (onlyAccessibleFacility)
navigate(`/facility/${onlyAccessibleFacility.id}/patient`);
else if (
!showAllFacilityUsers.includes(authUser.user_type) &&
!authUser.home_facility_object?.id
)
Notification.Error({
msg: "Oops! No home facility found",
});
else setShowDialog("create");
}}
className="w-full lg:w-fit"
>
<CareIcon icon="l-plus" className="text-lg" />
<p id="add-patient-div" className="lg:my-[2px]">
Add Patient
</p>
</ButtonV2>
<div >

Check failure on line 799 in src/components/Patient/ManagePatients.tsx

View workflow job for this annotation

GitHub Actions / lint

Delete `·`
<div className="flex w-full flex-col items-center justify-between md:flex-row md:gap-4 lg:gap-5">
<div className="mb-2 flex w-full flex-col items-center md:w-1/2 lg:w-fit lg:flex-row lg:gap-5">
<ButtonV2
id="add-patient-details"
onClick={() => {
const showAllFacilityUsers = ["DistrictAdmin", "StateAdmin"];
if (
qParams.facility &&
showAllFacilityUsers.includes(authUser.user_type)
)
navigate(`/facility/${qParams.facility}/patient`);
else if (
qParams.facility &&
!showAllFacilityUsers.includes(authUser.user_type) &&
authUser.home_facility_object?.id !== qParams.facility
)
Notification.Error({
msg: "Oops! Non-Home facility users don't have permission to perform this action.",
});
else if (
!showAllFacilityUsers.includes(authUser.user_type) &&
authUser.home_facility_object?.id
) {
navigate(
`/facility/${authUser.home_facility_object.id}/patient`,
);
} else if (onlyAccessibleFacility)
navigate(`/facility/${onlyAccessibleFacility.id}/patient`);
else if (
!showAllFacilityUsers.includes(authUser.user_type) &&
!authUser.home_facility_object?.id
)
Notification.Error({
msg: "Oops! No home facility found",
});
else setShowDialog("create");
}}
className="w-full md:w-auto lg:w-fit"
>
<CareIcon icon="l-plus" className="text-lg" />
<p id="add-patient-div" className="lg:my-[2px]">
Add Patient
</p>
</ButtonV2>
</div>
</div>
<div className="flex w-full flex-col items-center justify-end gap-2 lg:ml-3 lg:w-fit lg:flex-row lg:gap-3">
<div className="flex w-full flex-col items-center justify-end gap-2 md:w-1/2 md:flex-row md:gap-3 lg:w-fit lg:ml-3">
<Tabs
tabs={[
{ text: t("live"), value: 0 },
Expand Down Expand Up @@ -875,7 +877,7 @@
/>
{!!params.facility && (
<ButtonV2
className="w-full lg:w-fit"
className="w-full md:w-auto lg:w-fit"
id="doctor-connect-patient-button"
onClick={() => {
triggerGoal("Doctor Connect Clicked", {
Expand All @@ -891,9 +893,11 @@
</ButtonV2>
)}

<AdvancedFilterButton
onClick={() => advancedFilter.setShow(true)}
/>
<div className="w-full md:w-auto">
<AdvancedFilterButton
onClick={() => advancedFilter.setShow(true)}
/>
</div>
<SortDropdownMenu
options={PATIENT_SORT_OPTIONS}
selected={qParams.ordering}
Expand All @@ -914,7 +918,7 @@
});
}, 500);
}}
className="mr-5 w-full lg:w-fit"
className="w-full md:w-auto lg:w-fit"
>
<CareIcon icon="l-export" />
<span className="lg:my-[3px]">Export</span>
Expand Down
Loading