From 017cfb36457cbe293360c963f3d66257e5172907 Mon Sep 17 00:00:00 2001 From: Justyn Oh Date: Wed, 3 Apr 2024 10:10:42 +0800 Subject: [PATCH] ref: genericize EndPageBlock --- .../public-form/components/FormEndPage/FormEndPage.tsx | 2 +- .../components/FormEndPage/components/EndPageBlock.tsx | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/frontend/src/features/public-form/components/FormEndPage/FormEndPage.tsx b/frontend/src/features/public-form/components/FormEndPage/FormEndPage.tsx index f467587122..0be32c2a16 100644 --- a/frontend/src/features/public-form/components/FormEndPage/FormEndPage.tsx +++ b/frontend/src/features/public-form/components/FormEndPage/FormEndPage.tsx @@ -44,7 +44,7 @@ export const FormEndPage = ({ focusOnMount {...endPageProps} colorTheme={colorTheme} - previousSubmissionId={previousSubmissionId} + isButtonHidden={!!previousSubmissionId} /> {isFeedbackSectionHidden ? null : ( { const focusRef = useRef(null) useEffect(() => { @@ -55,8 +55,6 @@ export const EndPageBlock = ({ return 'You have successfully submitted your response.' }, [formTitle]) - const disableSubmitResponseButton = !!previousSubmissionId //disable for MRF 2nd respondent onwards - return ( <> @@ -84,7 +82,7 @@ export const EndPageBlock = ({ - {disableSubmitResponseButton || ( + {isButtonHidden || (