Skip to content

Commit

Permalink
Medication name missing in iPad - Fix (#9917)
Browse files Browse the repository at this point in the history
  • Loading branch information
amjithtitus09 authored Jan 12, 2025
1 parent dd68203 commit e6d2296
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import {
import { QuantityInput } from "@/components/Common/QuantityInput";
import ValueSetSelect from "@/components/Questionnaire/ValueSetSelect";

import { useIsMobile } from "@/hooks/use-mobile";
import useBreakpoints from "@/hooks/useBreakpoints";

import {
BOUNDS_DURATION_UNITS,
Expand Down Expand Up @@ -76,7 +76,7 @@ export function MedicationRequestQuestion({
const [medicationToDelete, setMedicationToDelete] = useState<number | null>(
null,
);
const isMobile = useIsMobile();
const desktopLayout = useBreakpoints({ lg: true, default: false });

const handleAddMedication = (medication: Code) => {
const newMedications: MedicationRequest[] = [
Expand Down Expand Up @@ -168,7 +168,7 @@ export function MedicationRequestQuestion({
<div className="min-w-fit">
<div
className={cn("max-w-[2144px] relative lg:border rounded-md", {
"bg-gray-50/50": isMobile,
"bg-gray-50/50": !desktopLayout,
})}
>
{/* Header - Only show on desktop */}
Expand Down Expand Up @@ -207,10 +207,14 @@ export function MedicationRequestQuestion({
</div>

{/* Body */}
<div className={cn("bg-white", { "bg-transparent": isMobile })}>
<div
className={cn("bg-white", {
"bg-transparent": !desktopLayout,
})}
>
{medications.map((medication, index) => (
<React.Fragment key={index}>
{isMobile ? (
{!desktopLayout ? (
<Collapsible
open={expandedMedicationIndex === index}
onOpenChange={() => {
Expand Down

0 comments on commit e6d2296

Please sign in to comment.