Skip to content

Commit

Permalink
Merge branch 'develop' into user-redirection
Browse files Browse the repository at this point in the history
  • Loading branch information
nihal467 authored Oct 30, 2023
2 parents d3998eb + 23bdb1f commit f769d47
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ let make = (
None
}, [state])


let handleClickOutside = %raw(`
function (event, ref, hideModal) {
if (ref.current && !ref.current.contains(event.target)) {
Expand All @@ -56,18 +55,18 @@ let make = (
}
})

let getStatus = (min, minText, max, maxText, val) => {
switch (val >= min, val <= max) {
| (true, true) => ("Normal", "#059669")
| (true, false) => (maxText, "#DC2626")
| _ => (minText, "#DC2626")
let getStatus = (min, minText, max, maxText, val) => {
switch (val >= min, val <= max) {
| (true, true) => ("Normal", "#059669")
| (true, false) => (maxText, "#DC2626")
| _ => (minText, "#DC2626")
}
}
}

<div
hidden={!show}
onClick={e => handleClickOutside(e, modalRef, hideModal)}
className={previewMode && innerWidth > 720 ? "" : "fixed w-full inset-0 z-40 overflow-y-auto"}>
className="absolute w-full inset-0 z-40 overflow-y-auto">
<div
hidden={!show}
className="flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0">
Expand All @@ -85,9 +84,7 @@ let getStatus = (min, minText, max, maxText, val) => {
<div className="mt-3 text-center sm:mt-0 sm:text-left">
<div className="flex gap-2 justify-center">
<span> {str("Region: ")} </span>
<span className="text-black">
{str(Pain.regionToString(state.region))}
</span>
<span className="text-black"> {str(Pain.regionToString(state.region))} </span>
</div>
<div className="flex flex-col sm:flex-row justify-center mt-2">
<div className="w-full">
Expand All @@ -108,7 +105,11 @@ let getStatus = (min, minText, max, maxText, val) => {
}
}}
getLabel={getStatus(2.0, "Low", 4.0, "High")}
hasError={ValidationUtils.isInputInRangeInt(0, 5, Belt.Float.toString(painScale)->Belt.Int.fromString)}
hasError={ValidationUtils.isInputInRangeInt(
0,
5,
Belt.Float.toString(painScale)->Belt.Int.fromString,
)}
/>
<div className="mt-2">
<label className="block font-medium text-black text-left mb-1">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ let make = (
<div
hidden={!show}
onClick={e => handleClickOutside(e, modalRef, hideModal)}
className={previewMode && innerWidth > 720 ? "" : "fixed w-full inset-0 z-40 overflow-y-auto"}>
className="absolute w-full inset-0 z-40 overflow-y-auto">
<div
hidden={!show}
className="flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0">
Expand Down Expand Up @@ -207,4 +207,4 @@ let make = (
</div>
</div>
</div>
}
}
16 changes: 8 additions & 8 deletions src/Components/Facility/FacilityCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ export const FacilityCard = (props: { facility: any; userType: any }) => {

return (
<div key={`usr_${facility.id}`} className="w-full">
<div className="block h-full rounded-lg bg-white shadow hover:border-primary-500">
<div className="block h-full overflow-hidden rounded-lg bg-white shadow hover:border-primary-500">
<div className="flex h-full">
<Link
href={`/facility/${facility.id}`}
className="group relative z-0 hidden w-1/4 items-center justify-center self-stretch bg-gray-300 md:flex"
className="group relative z-0 hidden w-1/4 min-w-[15%] items-center justify-center self-stretch bg-gray-300 md:flex"
>
{(facility.read_cover_image_url && (
<img
Expand All @@ -67,7 +67,7 @@ export const FacilityCard = (props: { facility: any; userType: any }) => {
<div className="h-full w-full grow">
<Link
href={`/facility/${facility.id}`}
className="group relative z-0 flex w-full items-center justify-center self-stretch bg-gray-300 md:hidden"
className="group relative z-0 flex w-full min-w-[15%] items-center justify-center self-stretch bg-gray-300 md:hidden"
>
{(facility.read_cover_image_url && (
<img
Expand All @@ -80,15 +80,15 @@ export const FacilityCard = (props: { facility: any; userType: any }) => {
)}
</Link>

<div className="flex h-fit w-full flex-col justify-between md:h-full">
<div className="flex h-fit w-full flex-col flex-wrap justify-between md:h-full">
<div className="w-full p-4">
<div className="flow-root">
{facility.kasp_empanelled && (
<div className="float-right ml-2 mt-2 inline-flex items-center rounded-md bg-yellow-100 px-2.5 py-0.5 text-sm font-medium leading-5 text-yellow-800">
{kasp_string}
</div>
)}
<div className="flex items-center justify-between">
<div className="flex flex-wrap items-center justify-between">
<Link
href={`/facility/${facility.id}`}
className="float-left text-xl font-bold capitalize text-inherit hover:text-inherit"
Expand Down Expand Up @@ -153,10 +153,10 @@ export const FacilityCard = (props: { facility: any; userType: any }) => {
</a>
</div>
</div>
<div className="flex-none border-t bg-gray-50 px-2 py-1 md:px-3">
<div className="flex flex-wrap border-t bg-gray-50 px-2 py-1 md:px-3">
<div className="flex justify-between py-2">
<div className="flex w-full flex-wrap justify-between gap-2">
<div className="flex gap-2">
<div className="flex flex-wrap gap-2">
<div
className={`tooltip ml-auto flex h-[38px] w-fit items-center justify-center rounded-md px-2 text-xl ${
facility.patient_count / facility.bed_count > 0.85
Expand Down Expand Up @@ -220,7 +220,7 @@ export const FacilityCard = (props: { facility: any; userType: any }) => {
</form>
</DialogModal>
</div>
<div className="flex gap-2">
<div className="flex flex-wrap gap-2">
{userType !== "Staff" ? (
<ButtonV2
id="facility-notify"
Expand Down

0 comments on commit f769d47

Please sign in to comment.