Skip to content

Commit

Permalink
Merge branch 'develop' into issue/9349/button_layout_in_asset_page
Browse files Browse the repository at this point in the history
  • Loading branch information
AdityaJ2305 authored Dec 23, 2024
2 parents 6bbf58e + 11dc10d commit f71839a
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 36 deletions.
44 changes: 34 additions & 10 deletions src/components/Facility/ConsultationCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export const ConsultationCard = (props: ConsultationProps) => {
: !itemData.current_bed
? t("assign_bed")
: t("switch_bed");

return (
<>
<DialogModal
Expand All @@ -53,16 +54,39 @@ export const ConsultationCard = (props: ConsultationProps) => {
)}
</DialogModal>
<div className="pb-16 block relative cursor-pointer border-l-2 px-4 border-l-secondary-300 hover:border-primary-500 transition-all before:absolute before:-left-[7px] before:top-0 before:w-3 before:aspect-square before:bg-secondary-400 before:rounded-full hover:before:bg-primary-500 before:transition-all">
<Chip
size="small"
variant={itemData.suggestion === "A" ? "alert" : "primary"}
text={
itemData.suggestion === "A" ? t("ip_encounter") : t("op_encounter")
}
className="-translate-y-2"
/>
<div className="text-sm">
{dayjs(itemData.created_date).format("DD/MM/YYYY")}
<div className="flex flex-wrap items-center gap-4 mt-4">
<div className="flex flex-col gap-1">
<Chip
size="small"
variant={itemData.suggestion === "A" ? "alert" : "primary"}
text={
itemData.suggestion === "A"
? t("ip_encounter")
: t("op_encounter")
}
className="-translate-y-2"
/>
<div className="text-sm">
{dayjs(itemData.created_date).format("DD/MM/YYYY")}
</div>
</div>

{/* Patient Status Section */}
<div className="flex items-center gap-2 -translate-y-5 ">
<div className="text-sm font-normal leading-5">
{t("patient_status")}
</div>
<Chip
size="small"
variant="custom"
className={
!itemData.discharge_date
? "bg-blue-100 text-blue-800"
: "bg-red-100 text-red-800"
}
text={!itemData.discharge_date ? "LIVE" : "DISCHARGED"}
/>
</div>
</div>

{itemData.is_kasp && (
Expand Down
18 changes: 0 additions & 18 deletions src/components/Patient/PatientDetailsTab/Demography.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { navigate } from "raviger";
import { Fragment, useEffect, useState } from "react";
import { useTranslation } from "react-i18next";

import Chip from "@/CAREUI/display/Chip";
import CareIcon from "@/CAREUI/icons/CareIcon";
import AuthorizedChild from "@/CAREUI/misc/AuthorizedChild";

Expand Down Expand Up @@ -356,23 +355,6 @@ export const Demography = (props: PatientProps) => {

<div className="lg:basis-4/5">
<div className="mb-2 flex flex-row justify-between">
<div className="w-1/2">
<div className="text-sm font-normal leading-5 text-secondary-700">
{t("patient_status")}
</div>
<div className="mt-1 text-xl font-semibold leading-5 text-secondary-900">
<Chip
size="medium"
variant="custom"
className={
patientData.is_active
? "bg-blue-100 text-blue-800"
: "bg-red-100 text-red-800"
}
text={patientData.is_active ? "LIVE" : "DISCHARGED"}
/>
</div>
</div>
<div>
<AuthorizedChild authorizeFor={NonReadOnlyUsers}>
{({ isAuthorized }) => (
Expand Down
16 changes: 8 additions & 8 deletions src/components/Shifting/ShiftingTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ export default function ShiftingTable(props: {
</div>
</div>

<div className="col-span-1 flex flex-col px-3 text-left">
<div className="3xl:flex-row mb-2 flex gap-2 sm:flex-row md:flex-row lg:flex-col xl:flex-row 2xl:flex-row">
<div className="col-span-1 flex flex-col text-left">
<div className="3xl:flex-row mb-2 flex gap-2 sm:flex-row md:flex-row lg:flex-col xl:flex-row 2xl:flex-row flex-wrap">
<dt
title={t("shifting_status")}
className={`mt-1 flex h-5 shrink-0 items-center rounded-full px-2 py-0.5 text-xs font-medium leading-4 ${
Expand Down Expand Up @@ -172,13 +172,13 @@ export default function ShiftingTable(props: {
</div>
</div>

<div className="col-span-1 text-left">
<div className="col-span-1 flex flex-col flex-wrap text-left">
<dt
title={t("origin_facility")}
className="flex items-center text-left text-sm font-medium leading-5 text-secondary-500"
>
<CareIcon icon="l-plane-departure" className="mr-2" />
<dd className="text-sm font-bold leading-5 text-secondary-900">
<dd className="text-sm flex flex-wrap font-bold leading-5 text-secondary-900">
{shift.origin_facility_object?.name}
</dd>
</dt>
Expand All @@ -197,17 +197,17 @@ export default function ShiftingTable(props: {

<dt
title={t("assigned_facility")}
className="flex items-center text-left text-sm font-medium leading-5 text-secondary-500"
className="flex flex-wrap items-center text-left text-sm font-medium leading-5 text-secondary-500"
>
<CareIcon icon="l-plane-arrival" className="mr-2" />
<dd className="text-sm font-bold leading-5 text-secondary-900">
<dd className="text-sm flex flex-wrap font-bold leading-5 text-secondary-900">
{shift.assigned_facility_external ||
shift.assigned_facility_object?.name ||
t("yet_to_be_decided")}
</dd>
</dt>
</div>
<div className="col-span-1 mt-2 flex flex-col text-left">
<div className="ml-3 col-span-1 mt-2 flex flex-col text-left">
<ButtonV2
onClick={(_) => navigate(`/shifting/${shift.external_id}`)}
variant="secondary"
Expand All @@ -219,7 +219,7 @@ export default function ShiftingTable(props: {
{shift.status === "COMPLETED" && shift.assigned_facility && (
<div className="mt-2">
<ButtonV2
className="w-full"
className="w-full text-wrap"
disabled={
!shift.patient_object.allow_transfer ||
!(
Expand Down

0 comments on commit f71839a

Please sign in to comment.