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

Show more CNS monitors on large displays #7440

Closed
3 changes: 2 additions & 1 deletion src/Common/hooks/useBreakpoints.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import useWindowDimensions from "./useWindowDimensions";

type Breakpoints = "vs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl";
type Breakpoints = "vs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4k";

// Ensure that the breakpoint widths are sorted in ascending order.
const BREAKPOINT_WIDTH: Record<Breakpoints, number> = {
Expand All @@ -11,6 +11,7 @@ const BREAKPOINT_WIDTH: Record<Breakpoints, number> = {
xl: 1280,
"2xl": 1536,
"3xl": 1920,
"4k": 2560,
};

/**
Expand Down
12 changes: 6 additions & 6 deletions src/Components/Facility/CentralNursingStation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ import useVitalsAspectRatioConfig from "../VitalsMonitor/useVitalsAspectRatioCon
import useQuery from "../../Utils/request/useQuery";
import routes from "../../Redux/api";
import { getVitalsMonitorSocketUrl } from "../VitalsMonitor/utils";

const PER_PAGE_LIMIT = 6;
import useBreakpoints from "../../Common/hooks/useBreakpoints";

const SORT_OPTIONS: SortOption[] = [
{ isAscending: true, value: "bed__name" },
Expand All @@ -33,18 +32,19 @@ interface Props {
}

export default function CentralNursingStation({ facilityId }: Props) {
const perPageLimit = useBreakpoints({ "4k": 9, default: 6 });
const { t } = useTranslation();
const [isFullscreen, setFullscreen] = useFullscreen();
const { qParams, updateQuery, removeFilter, updatePage } = useFilters({
limit: PER_PAGE_LIMIT,
limit: perPageLimit,
});
const query = useQuery(routes.listPatientAssetBeds, {
pathParams: { facility_external_id: facilityId },
query: {
...qParams,
page: qParams.page || 1,
limit: PER_PAGE_LIMIT,
offset: (qParams.page ? qParams.page - 1 : 0) * PER_PAGE_LIMIT,
limit: perPageLimit,
offset: (qParams.page ? qParams.page - 1 : 0) * perPageLimit,
asset_class: "HL7MONITOR",
ordering: qParams.ordering || "bed__name",
bed_is_occupied:
Expand Down Expand Up @@ -183,7 +183,7 @@ export default function CentralNursingStation({ facilityId }: Props) {
<Pagination
className=""
cPage={qParams.page}
defaultPerPage={PER_PAGE_LIMIT}
defaultPerPage={perPageLimit}
data={{ totalCount }}
onChange={(page) => updatePage(page)}
/>
Expand Down
Loading