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: improved tablet view responsiveness #10379

Merged
merged 3 commits into from
Feb 4, 2025
Merged
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
280 changes: 142 additions & 138 deletions src/pages/Encounters/EncounterList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ export function EncounterList({

return (
<Page title={t("encounters")} hideBack={true}>
<div className="space-y-4 mt-2">
<div className="rounded-lg border bg-card shadow-sm">
<div className="space-y-4 mt-2 flex flex-col">
<div className="rounded-lg border bg-card shadow-sm flex flex-col">
<div className="flex flex-col">
<div className="flex flex-wrap items-center justify-between gap-2 p-4">
<div className="flex flex-wrap items-center gap-2">
Expand Down Expand Up @@ -467,191 +467,195 @@ export function EncounterList({
<div className="hidden md:flex items-center">
<Tabs value={status || "all"} className="w-full">
<TabsList className="bg-transparent p-0 h-8">
<div className="flex flex-wrap">
<TabsTrigger
value="all"
className="data-[state=active]:bg-primary/10 data-[state=active]:text-primary"
onClick={() =>
updateQuery({
...{ encounter_class: encounterClass, priority },
status: undefined,
})
}
>
{t("all")}
</TabsTrigger>
<TabsTrigger
value="planned"
className="data-[state=active]:bg-primary/10 data-[state=active]:text-primary"
onClick={() =>
updateQuery({
...{ encounter_class: encounterClass, priority },
status: "planned",
})
}
>
<CareIcon icon="l-calender" className="mr-2 h-4 w-4" />
{t("encounter_status__planned")}
</TabsTrigger>
<TabsTrigger
value="in_progress"
className="data-[state=active]:bg-primary/10 data-[state=active]:text-primary"
onClick={() =>
updateQuery({
...{ encounter_class: encounterClass, priority },
status: "in_progress",
})
}
>
<CareIcon icon="l-spinner" className="mr-2 h-4 w-4" />
{t("encounter_class__in_progress")}
</TabsTrigger>
<TabsTrigger
value="discharged"
className="data-[state=active]:bg-primary/10 data-[state=active]:text-primary"
onClick={() =>
updateQuery({
...{ encounter_class: encounterClass, priority },
status: "discharged",
})
}
>
<CareIcon icon="l-home" className="mr-2 h-4 w-4" />
{t("discharge")}
</TabsTrigger>
<TabsTrigger
value="completed"
className="data-[state=active]:bg-primary/10 data-[state=active]:text-primary"
onClick={() =>
updateQuery({
...{ encounter_class: encounterClass, priority },
status: "completed",
})
}
>
<CareIcon icon="l-check" className="mr-2 h-4 w-4" />
{t("completed")}
</TabsTrigger>
<TabsTrigger
value="cancelled"
className="data-[state=active]:bg-primary/10 data-[state=active]:text-primary"
onClick={() =>
updateQuery({
...{ encounter_class: encounterClass, priority },
status: "cancelled",
})
}
>
<CareIcon icon="l-x" className="mr-2 h-4 w-4" />
{t("cancelled")}
</TabsTrigger>
</div>
</TabsList>
</Tabs>
</div>
</div>

<Separator className="hidden md:block" />

{/* Class Filter - Desktop */}
<div className="hidden md:block p-4">
<Tabs value={encounterClass || "all"} className="w-full">
<TabsList className="bg-transparent p-0 h-8">
<div className="flex flex-wrap">
<TabsTrigger
value="all"
className="data-[state=active]:bg-primary/10 data-[state=active]:text-primary"
onClick={() =>
updateQuery({
...{ encounter_class: encounterClass, priority },
status: undefined,
status,
priority,
encounter_class: undefined,
})
}
>
All
{t("all")}
</TabsTrigger>
<TabsTrigger
value="planned"
value="imp"
className="data-[state=active]:bg-primary/10 data-[state=active]:text-primary"
onClick={() =>
updateQuery({
...{ encounter_class: encounterClass, priority },
status: "planned",
status,
priority,
encounter_class: "imp",
})
}
>
<CareIcon icon="l-calender" className="mr-2 h-4 w-4" />
Planned
<CareIcon icon="l-hospital" className="mr-2 h-4 w-4" />
{t("encounter_class__imp")}
</TabsTrigger>
<TabsTrigger
value="in_progress"
value="amb"
className="data-[state=active]:bg-primary/10 data-[state=active]:text-primary"
onClick={() =>
updateQuery({
...{ encounter_class: encounterClass, priority },
status: "in_progress",
status,
priority,
encounter_class: "amb",
})
}
>
<CareIcon icon="l-spinner" className="mr-2 h-4 w-4" />
In Progress
<CareIcon icon="l-user" className="mr-2 h-4 w-4" />
{t("encounter_class__amb")}
</TabsTrigger>
<TabsTrigger
value="discharged"
value="obsenc"
className="data-[state=active]:bg-primary/10 data-[state=active]:text-primary"
onClick={() =>
updateQuery({
...{ encounter_class: encounterClass, priority },
status: "discharged",
status,
priority,
encounter_class: "obsenc",
})
}
>
<CareIcon icon="l-home" className="mr-2 h-4 w-4" />
Discharged
<CareIcon icon="l-eye" className="mr-2 h-4 w-4" />
{t("encounter_class__obsenc")}
</TabsTrigger>
<TabsTrigger
value="completed"
value="emer"
className="data-[state=active]:bg-primary/10 data-[state=active]:text-primary"
onClick={() =>
updateQuery({
...{ encounter_class: encounterClass, priority },
status: "completed",
status,
priority,
encounter_class: "emer",
})
}
>
<CareIcon icon="l-check" className="mr-2 h-4 w-4" />
Completed
<CareIcon icon="l-ambulance" className="mr-2 h-4 w-4" />
{t("emergency")}
</TabsTrigger>
<TabsTrigger
value="cancelled"
value="vr"
className="data-[state=active]:bg-primary/10 data-[state=active]:text-primary"
onClick={() =>
updateQuery({
...{ encounter_class: encounterClass, priority },
status: "cancelled",
status,
priority,
encounter_class: "vr",
})
}
>
<CareIcon icon="l-x" className="mr-2 h-4 w-4" />
Cancelled
<CareIcon icon="l-video" className="mr-2 h-4 w-4" />
{t("encounter_class__vr")}
</TabsTrigger>
</TabsList>
</Tabs>
</div>
</div>

<Separator className="hidden md:block" />

{/* Class Filter - Desktop */}
<div className="hidden md:block p-4">
<Tabs value={encounterClass || "all"} className="w-full">
<TabsList className="bg-transparent p-0 h-8">
<TabsTrigger
value="all"
className="data-[state=active]:bg-primary/10 data-[state=active]:text-primary"
onClick={() =>
updateQuery({
status,
priority,
encounter_class: undefined,
})
}
>
All Types
</TabsTrigger>
<TabsTrigger
value="imp"
className="data-[state=active]:bg-primary/10 data-[state=active]:text-primary"
onClick={() =>
updateQuery({
status,
priority,
encounter_class: "imp",
})
}
>
<CareIcon icon="l-hospital" className="mr-2 h-4 w-4" />
Inpatient
</TabsTrigger>
<TabsTrigger
value="amb"
className="data-[state=active]:bg-primary/10 data-[state=active]:text-primary"
onClick={() =>
updateQuery({
status,
priority,
encounter_class: "amb",
})
}
>
<CareIcon icon="l-user" className="mr-2 h-4 w-4" />
Ambulatory
</TabsTrigger>
<TabsTrigger
value="obsenc"
className="data-[state=active]:bg-primary/10 data-[state=active]:text-primary"
onClick={() =>
updateQuery({
status,
priority,
encounter_class: "obsenc",
})
}
>
<CareIcon icon="l-eye" className="mr-2 h-4 w-4" />
Observation
</TabsTrigger>
<TabsTrigger
value="emer"
className="data-[state=active]:bg-primary/10 data-[state=active]:text-primary"
onClick={() =>
updateQuery({
status,
priority,
encounter_class: "emer",
})
}
>
<CareIcon icon="l-ambulance" className="mr-2 h-4 w-4" />
Emergency
</TabsTrigger>
<TabsTrigger
value="vr"
className="data-[state=active]:bg-primary/10 data-[state=active]:text-primary"
onClick={() =>
updateQuery({
status,
priority,
encounter_class: "vr",
})
}
>
<CareIcon icon="l-video" className="mr-2 h-4 w-4" />
Virtual
</TabsTrigger>
<TabsTrigger
value="hh"
className="data-[state=active]:bg-primary/10 data-[state=active]:text-primary"
onClick={() =>
updateQuery({
status,
priority,
encounter_class: "hh",
})
}
>
<CareIcon icon="l-home" className="mr-2 h-4 w-4" />
Home Health
</TabsTrigger>
<TabsTrigger
value="hh"
className="data-[state=active]:bg-primary/10 data-[state=active]:text-primary"
onClick={() =>
updateQuery({
status,
priority,
encounter_class: "hh",
})
}
>
<CareIcon icon="l-home" className="mr-2 h-4 w-4" />
{t("encounter_class__hh")}
</TabsTrigger>
</div>
</TabsList>
</Tabs>
</div>
Expand Down
Loading