Skip to content

Commit

Permalink
fix: oxygen description table on facility page (#2789)
Browse files Browse the repository at this point in the history
* fix: oxygen description table on facility page

* fix: oxygen description table on facility page

* fix: double line
  • Loading branch information
kunatastic authored Jul 6, 2022
1 parent 7aaf12a commit 922f6db
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 47 deletions.
108 changes: 61 additions & 47 deletions src/Components/Facility/FacilityHome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
PatientStatsModel,
} from "./models";
import moment from "moment";
import { RoleButton, roleType } from "../Common/RoleButton";
import { RoleButton } from "../Common/RoleButton";
const Loading = loadable(() => import("../Common/Loading"));
const PageTitle = loadable(() => import("../Common/PageTitle"));

Expand Down Expand Up @@ -118,7 +118,7 @@ export const FacilityHome = (props: any) => {
);
} else {
capacityList = BED_TYPES.map((x) => {
let res = capacityData.find((data) => {
const res = capacityData.find((data) => {
return data.room_type === x.id;
});
if (res) {
Expand Down Expand Up @@ -148,7 +148,7 @@ export const FacilityHome = (props: any) => {
});
}

let stats = patientStatsData.map((data: PatientStatsModel, index) => {
const stats = patientStatsData.map((data: PatientStatsModel, index) => {
return (
<tr className="border" key={index}>
<td className="border px-4 py-2 whitespace-nowrap">
Expand Down Expand Up @@ -225,12 +225,8 @@ export const FacilityHome = (props: any) => {
<h1 className="text-4xl font-bold">{facilityData.name}</h1>
<p className="text-xl text-gray-700">
Last updated{" "}
{
// @ts-ignore
facilityData?.modified_date &&
// @ts-ignore
moment(facilityData?.modified_date).fromNow()
}
{facilityData?.modified_date &&
moment(facilityData?.modified_date).fromNow()}
</p>
</div>
<div className="flex items-center flex-1">
Expand Down Expand Up @@ -390,43 +386,61 @@ export const FacilityHome = (props: any) => {
Information on Oxygen
</h1>

<div className="grid grid-cols-5 mb-6 max-w-2xl p-0 bg-white break-all">
<div className="border p-2"></div>
<div className="border p-2 text-right font-semibold">Liquid</div>
<div className="border p-2 text-right font-semibold">B</div>
<div className="border p-2 text-right font-semibold">C</div>
<div className="border p-2 text-right font-semibold">D</div>
<div className="border p-2 font-semibold">Capacity</div>
<div className="border p-2 text-right ">
{facilityData.oxygen_capacity}
</div>
<div className="border p-2 text-right ">
{facilityData.type_b_cylinders}
</div>
<div className="border p-2 text-right ">
{facilityData.type_c_cylinders}
</div>
<div className="border p-2 text-right ">
{facilityData.type_d_cylinders}
</div>
<div className="border p-2 font-semibold">
Daily Expected Consumption
</div>
<div className="border p-2 text-right">
{facilityData.expected_oxygen_requirement}
</div>
<div className="border p-2 text-right">
{facilityData.expected_type_b_cylinders}
</div>
<div className="border p-2 text-right">
{facilityData.expected_type_c_cylinders}
</div>
<div className="border p-2 text-right">
{facilityData.expected_type_d_cylinders}
</div>
<div className="overflow-x-auto sm:rounded-lg mt-4">
<table className="border-2 rounded overflow-hidden align-middle">
<thead>
<tr className="white border">
<th className="border px-4 py-2"></th>
<th className="border px-4 py-2 whitespace-nowrap">
Oxygen capacity
</th>
<th className="border px-4 py-2 whitespace-nowrap">
Type B cylinder
</th>
<th className="border px-4 py-2 whitespace-nowrap">
Type C cylinder
</th>
<th className="border px-4 py-2 whitespace-nowrap">
Type D cylinder
</th>
</tr>
<tr className="border">
<th className="border px-4 py-2">Capacity</th>
<td className="border px-4 py-2 text-center">
{facilityData.oxygen_capacity}
</td>
<td className="border px-4 py-2 text-center">
{facilityData.type_b_cylinders}
</td>
<td className="border px-4 py-2 text-center">
{facilityData.type_c_cylinders}
</td>
<td className="border px-4 py-2 text-center">
{facilityData.type_d_cylinders}
</td>
</tr>
<tr className="border">
<th className="border px-4 py-2">
Daily Expected Consumption
</th>
<td className="border px-4 py-2 text-center">
{facilityData.expected_oxygen_requirement}
</td>
<td className="border px-4 py-2 text-center">
{facilityData.expected_type_b_cylinders}
</td>
<td className="border px-4 py-2 text-center">
{facilityData.expected_type_c_cylinders}
</td>
<td className="border px-4 py-2 text-center">
{facilityData.expected_type_d_cylinders}
</td>
</tr>
</thead>
</table>
</div>
</div>
<div className="mt-4">
<div className="mt-6">
<div className="md:flex justify-between md:border-b md:pb-2">
<div className="font-semibold text-xl">Bed Capacity</div>
<RoleButton
Expand Down Expand Up @@ -457,7 +471,7 @@ export const FacilityHome = (props: any) => {
</div>
<div className="mt-4 flex flex-wrap">{doctorList}</div>
</div>
<div className="-my-2 py-2 overflow-x-auto sm:-mx-6 sm:px-6 lg:-mx-8 lg:px-8 mt-4">
<div className="-my-2 py-2 sm:-mx-6 sm:px-6 lg:-mx-8 lg:px-8 mt-4">
<div className="md:flex justify-between md:border-b md:pb-2">
<div className="font-semibold text-xl">Corona Triage</div>
<RoleButton
Expand All @@ -470,8 +484,8 @@ export const FacilityHome = (props: any) => {
Add Triage
</RoleButton>
</div>
<div className="align-middle inline-block min-w-full shadow overflow-hidden sm:rounded-lg border-b border-gray-200 mt-4">
<table className="min-w-full border-2 rounded overflow-hidden">
<div className="overflow-x-auto min-w-full shadow overflow-hidden sm:rounded-lg border-b border-gray-200 mt-4">
<table className="min-w-full border-2 rounded overflow-hidden align-middle">
<thead>
<tr className="white border">
<th className="border px-4 py-2">Date</th>
Expand Down
2 changes: 2 additions & 0 deletions src/Components/Facility/models.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ export interface FacilityModel {
district_object?: DistrictModel;
state_object?: StateModel;
ward_object?: WardModel;
modified_date?: string;
created_date?: string;
}

export interface CapacityModal {
Expand Down

0 comments on commit 922f6db

Please sign in to comment.