From 509ec019e3c1ec545439accdd3f5981a2397133f Mon Sep 17 00:00:00 2001 From: nncluzu Date: Wed, 9 Oct 2024 17:18:22 +0200 Subject: [PATCH] front: Allow creation of new projetc/study/scenario if the user has OpsWrite role. Signed-off-by: nncluzu --- front/src/common/AddNewCard.tsx | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/front/src/common/AddNewCard.tsx b/front/src/common/AddNewCard.tsx index c0f364fbabb..3a9720cfbc8 100644 --- a/front/src/common/AddNewCard.tsx +++ b/front/src/common/AddNewCard.tsx @@ -3,6 +3,7 @@ import type { ReactNode } from 'react'; import { useTranslation } from 'react-i18next'; import { FaPlus } from 'react-icons/fa'; +import RoleBasedContent from './authorization/components/RoleBasedContent'; import { useModal } from './BootstrapSNCF/ModalSNCF'; type AddNewCardProps = { @@ -24,16 +25,18 @@ const AddNewCard = ({ const { openModal } = useModal(); return ( -
openModal(modalComponent, 'xl', 'no-close-modal')} - > - -
{t(legendTranslationKey)}
-
+ +
openModal(modalComponent, 'xl', 'no-close-modal')} + > + +
{t(legendTranslationKey)}
+
+
); };