From 8fe5ab0a10e3b9e01aab65f8072aafbd52522c24 Mon Sep 17 00:00:00 2001 From: Ana Garcia Date: Thu, 27 Jun 2024 08:54:36 +0200 Subject: [PATCH] Cancel not mandatory in forms --- src/webapp/components/form-page/FormPage.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/webapp/components/form-page/FormPage.tsx b/src/webapp/components/form-page/FormPage.tsx index 300784ad..6fa37af9 100644 --- a/src/webapp/components/form-page/FormPage.tsx +++ b/src/webapp/components/form-page/FormPage.tsx @@ -12,7 +12,7 @@ type FormPageProps = { cancelLabel?: string; children: React.ReactNode; onSave: () => void; - onCancel: () => void; + onCancel?: () => void; }; export const FormPage: React.FC = React.memo( @@ -31,9 +31,11 @@ export const FormPage: React.FC = React.memo( - + {onCancel && ( + + )}