Skip to content

Commit 69c263c

Browse files
authored
feat: Add prop to toggle patient banner rendering (#624)
* enable toggling showPatientBanner in non-workspaces zones * Syntax update
1 parent a451e43 commit 69c263c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/form-engine.component.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ interface FormEngineProps {
3434
handleConfirmQuestionDeletion?: (question: Readonly<FormField>) => Promise<void>;
3535
markFormAsDirty?: (isDirty: boolean) => void;
3636
hideControls?: boolean;
37+
hidePatientBanner?: boolean;
3738
preFilledQuestions?: PreFilledQuestions;
3839
}
3940

@@ -51,6 +52,7 @@ const FormEngine = ({
5152
handleConfirmQuestionDeletion,
5253
markFormAsDirty,
5354
hideControls = false,
55+
hidePatientBanner = false,
5456
preFilledQuestions,
5557
}: FormEngineProps) => {
5658
const { t } = useTranslation();
@@ -75,8 +77,11 @@ const FormEngine = ({
7577
} = useFormJson(formUUID, formJson, encounterUUID, formSessionIntent, preFilledQuestions);
7678

7779
const showPatientBanner = useMemo(() => {
80+
if (hidePatientBanner) {
81+
return false;
82+
}
7883
return patient && workspaceSize === 'ultra-wide' && mode !== 'embedded-view';
79-
}, [patient, mode, workspaceSize]);
84+
}, [patient, mode, workspaceSize, hidePatientBanner]);
8085

8186
const isFormWorkspaceTooNarrow = useMemo(() => ['narrow'].includes(workspaceSize), [workspaceSize]);
8287

0 commit comments

Comments
 (0)