Skip to content

Commit

Permalink
Added translations in encounter page and minor fixes in patient regis…
Browse files Browse the repository at this point in the history
…tration form (#10264)
  • Loading branch information
Mahendar0701 authored Feb 2, 2025
1 parent 313f0b5 commit 9b50dfa
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/components/Patient/PatientInfoCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ export default function PatientInfoCard(props: PatientInfoCardProps) {
>
{patient.name}
<div className="mt-[6px] text-sm font-semibold text-secondary-600">
{formatPatientAge(patient, true)}{patient.gender}
{formatPatientAge(patient, true)}{" "}
{t(`GENDER__${patient.gender}`)}
</div>
</div>
</div>
Expand All @@ -114,7 +115,8 @@ export default function PatientInfoCard(props: PatientInfoCardProps) {
>
{patient.name}
<div className="ml-3 mr-2 mt-[6px] text-sm font-semibold text-secondary-600">
{formatPatientAge(patient, true)}{patient.gender}
{formatPatientAge(patient, true)}{" "}
{t(`GENDER__${patient.gender}`)}
</div>
</div>
<div className="grid gap-4 grid-cols-3 mt-2 md:mt-0">
Expand Down
10 changes: 9 additions & 1 deletion src/components/Patient/PatientRegistration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,15 @@ export default function PatientRegistration(
data-cy="age-input"
/>
</FormControl>

<FormMessage />
{form.getValues("age") && (
<div className="text-violet-600 text-sm font-bold">
{t("year_of_birth")}:{" "}
{new Date().getFullYear() -
Number(form.getValues("age"))}
</div>
)}
</FormItem>
)}
/>
Expand Down Expand Up @@ -679,7 +687,7 @@ export default function PatientRegistration(
/>
</div>

<div className="grid grid-cols-2 gap-4">
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
{form.watch("nationality") === "India" && (
<FormField
control={form.control}
Expand Down

0 comments on commit 9b50dfa

Please sign in to comment.