From 3464fe7155a18545aee16c9e91925703f1ff6aa0 Mon Sep 17 00:00:00 2001 From: Brandon Bouchard Date: Mon, 17 Jul 2023 08:55:28 -0700 Subject: [PATCH] Remove 'Next' button (non-PI) for PIA Next Steps - Drafters without a role will no longer see a next button on the next steps tab --- .../components/public/PIANavButton/index.tsx | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/src/frontend/src/components/public/PIANavButton/index.tsx b/src/frontend/src/components/public/PIANavButton/index.tsx index d08daa7c9..334a33c0d 100644 --- a/src/frontend/src/components/public/PIANavButton/index.tsx +++ b/src/frontend/src/components/public/PIANavButton/index.tsx @@ -1,8 +1,9 @@ import { useLocation, useNavigate } from 'react-router-dom'; import { INavButton } from './interface'; import HandleState from './handleState'; +import { roleCheck } from '../../../utils/helper.util'; -const PIANavButton = ({ pages }: INavButton) => { +const PIANavButton = ({ pages, isDelegate }: INavButton) => { const { pathname } = useLocation(); const navigate = useNavigate(); @@ -30,6 +31,8 @@ const PIANavButton = ({ pages }: INavButton) => { } }; + const userRole = roleCheck().roles; + return ( <> {(HandleState(pages, pathname, 'prev') || @@ -49,18 +52,19 @@ const PIANavButton = ({ pages }: INavButton) => { : 'Back'} )} - {HandleState(pages, pathname, 'next') && ( - - )} + {HandleState(pages, pathname, 'next') && + (!isDelegate || userRole !== undefined) && ( + + )} );