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

Dosage heading is misaligned in the prescription module #8645 #8751

Merged
Show file tree
Hide file tree
Changes from 13 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
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 TableContent = () => (
rithviknishad marked this conversation as resolved.
Show resolved Hide resolved
<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">
<TableContent />
rithviknishad marked this conversation as resolved.
Show resolved Hide resolved
</div>
</div>
</td>
<td className="hidden lg:table-cell">
<TableContent />
rithviknishad marked this conversation as resolved.
Show resolved Hide resolved
</td>

<td />

Expand Down
Loading