Skip to content

Commit 07d1c55

Browse files
committed
transform chips to uppercase
1 parent 004c234 commit 07d1c55

3 files changed

Lines changed: 42 additions & 40 deletions

File tree

web/components/patients/PatientDetailView.tsx

Lines changed: 40 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,7 @@ export const PatientDetailView = ({
282282
return <LoadingContainer/>
283283
}
284284

285-
const patient = patientData?.patient
286-
const patientName = patient ? `${patient.firstname} ${patient.lastname}` : ''
285+
const patientName = patientData?.patient ? `${patientData.patient.firstname} ${patientData.patient.lastname}` : ''
287286
const patientLocation = selectedLocations.length > 0 ? selectedLocations.map(loc => formatLocationPath(loc)).join(' ▸ ') : ''
288287

289288
const handleToggleDone = (taskId: string, done: boolean) => {
@@ -300,8 +299,8 @@ export const PatientDetailView = ({
300299
<div className="px-1 py-3 mb-4">
301300
<div className="flex items-center justify-between">
302301
<div className="font-semibold text-lg">{patientName}</div>
303-
{patient?.state && (
304-
<PatientStateChip state={patient.state} />
302+
{patientData?.patient?.state && (
303+
<PatientStateChip state={patientData.patient.state} />
305304
)}
306305
</div>
307306
{patientLocation && (
@@ -464,39 +463,42 @@ export const PatientDetailView = ({
464463
</FormElementWrapper>
465464
)}
466465

467-
{isEditMode && patientId && patient && (
468-
<FormElementWrapper label={translation('patientActions')}>
469-
{() => (
470-
<div className="flex gap-2 flex-wrap">
471-
{patient.state !== PatientState.Admitted && (
472-
<Button
473-
onClick={() => admitPatient({ id: patientId })}
474-
color="positive"
475-
>
476-
{translation('admitPatient')}
477-
</Button>
478-
)}
479-
{patient.state !== PatientState.Discharged && (
480-
<Button
481-
onClick={() => dischargePatient({ id: patientId })}
482-
color="neutral"
483-
coloringStyle="outline"
484-
>
485-
{translation('dischargePatient')}
486-
</Button>
487-
)}
488-
{patient.state !== PatientState.Wait && (
489-
<Button
490-
onClick={() => waitPatient({ id: patientId })}
491-
color="warning"
492-
>
493-
{translation('waitPatient')}
494-
</Button>
495-
)}
496-
</div>
497-
)}
498-
</FormElementWrapper>
499-
)}
466+
{isEditMode && patientId && patientData?.patient && (() => {
467+
const patient = patientData.patient
468+
return (
469+
<FormElementWrapper label={translation('patientActions')}>
470+
{() => (
471+
<div className="flex gap-2 flex-wrap">
472+
{patient.state !== PatientState.Admitted && (
473+
<Button
474+
onClick={() => admitPatient({ id: patientId })}
475+
color="positive"
476+
>
477+
{translation('admitPatient')}
478+
</Button>
479+
)}
480+
{patient.state !== PatientState.Discharged && (
481+
<Button
482+
onClick={() => dischargePatient({ id: patientId })}
483+
color="neutral"
484+
coloringStyle="outline"
485+
>
486+
{translation('dischargePatient')}
487+
</Button>
488+
)}
489+
{patient.state !== PatientState.Wait && (
490+
<Button
491+
onClick={() => waitPatient({ id: patientId })}
492+
color="warning"
493+
>
494+
{translation('waitPatient')}
495+
</Button>
496+
)}
497+
</div>
498+
)}
499+
</FormElementWrapper>
500+
)
501+
})()}
500502

501503
<FormElementWrapper label={translation('assignedLocation')}>
502504
{({ isShowingError: _, setIsShowingError: _2, ...bag }) => (
@@ -571,7 +573,7 @@ export const PatientDetailView = ({
571573
</div>
572574
)}
573575

574-
{isEditMode && patientId && patient && patient.state !== PatientState.Dead && (
576+
{isEditMode && patientId && patientData?.patient && patientData.patient.state !== PatientState.Dead && (
575577
<div className="flex-none pt-4 mt-auto border-t border-divider flex justify-end gap-2">
576578
<Button
577579
onClick={() => markPatientDead({ id: patientId })}

web/components/patients/PatientList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ export const PatientList = forwardRef<PatientListRef, PatientListProps>(({ locat
154154
<Chip
155155
color={sex === Sex.Unknown ? 'neutral' : 'none'}
156156
size="small"
157-
className={colorClass}
157+
className={`${colorClass} font-[var(--font-space-grotesk)] uppercase`}
158158
>
159159
<span>{label}</span>
160160
</Chip>

web/components/patients/PatientStateChip.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const PatientStateChip = ({ state }: PatientStateChipProps) => {
2525
}
2626

2727
return (
28-
<Chip color={getColor(state)} size="small">
28+
<Chip color={getColor(state)} size="small" className="font-[var(--font-space-grotesk)] uppercase">
2929
{translation('patientState', { state: state as string })}
3030
</Chip>
3131
)

0 commit comments

Comments
 (0)