Skip to content

Commit

Permalink
Dosage heading is misaligned in the prescription module #8645 (#8751)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sulochan-khadka authored Nov 11, 2024
1 parent fc4f94d commit 8a9078d
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,17 @@ export default function MedicineAdministrationTable({
<thead className="sticky top-0 z-10 bg-secondary-50 text-xs font-medium text-black">
<tr>
<th className="sticky left-0 z-20 bg-secondary-50 py-3 pl-4 text-left">
<div className="flex justify-between gap-2">
<span className="text-sm">{t("medicine")}</span>
<span className="hidden px-2 text-center text-xs leading-none lg:block">
<p>Dosage &</p>
<p>
{prescriptions[0]?.dosage_type !== "PRN"
? "Frequency"
: "Indicator"}
</p>
</span>
</div>
<span className="text-sm">{t("medicine")}</span>
</th>
<th>
<span className="hidden px-2 text-center text-xs leading-none lg:block">
<p>{t("dosage")} &</p>
<p>
{prescriptions[0]?.dosage_type !== "PRN"
? t("frequency")
: t("indicator")}
</p>
</span>
</th>

<th>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,25 @@ export default function MedicineAdministrationTableRow({
key: `${prescription.last_administration?.administered_date}`,
},
);
const DosageFrequencyInfo = () => (
<div className="flex justify-center">
<div className="flex gap-1 text-xs font-semibold text-secondary-900 lg:flex-col lg:px-2 lg:text-center">
{prescription.dosage_type !== "TITRATED" ? (
<p>{prescription.base_dosage}</p>
) : (
<p>
{prescription.base_dosage} - {prescription.target_dosage}
</p>
)}

<p className="max-w-[6rem] truncate">
{prescription.dosage_type !== "PRN"
? t("PRESCRIPTION_FREQUENCY_" + prescription.frequency)
: prescription.indicator}
</p>
</div>
</div>
);

return (
<>
Expand Down Expand Up @@ -216,24 +235,14 @@ export default function MedicineAdministrationTableRow({
{prescription.medicine_object?.generic}
</span>
</div>

<div className="flex gap-1 text-xs font-semibold text-secondary-900 lg:flex-col lg:px-2 lg:text-center">
{prescription.dosage_type !== "TITRATED" ? (
<p>{prescription.base_dosage}</p>
) : (
<p>
{prescription.base_dosage} - {prescription.target_dosage}
</p>
)}

<p>
{prescription.dosage_type !== "PRN"
? t("PRESCRIPTION_FREQUENCY_" + prescription.frequency)
: prescription.indicator}
</p>
<div className="block lg:hidden">
<DosageFrequencyInfo />
</div>
</div>
</td>
<td className="hidden lg:table-cell">
<DosageFrequencyInfo />
</td>

<td />

Expand Down

0 comments on commit 8a9078d

Please sign in to comment.