diff --git a/frontend/src/features/public-form/components/FormEndPage/FormEndPage.tsx b/frontend/src/features/public-form/components/FormEndPage/FormEndPage.tsx index c3eb632e64..f467587122 100644 --- a/frontend/src/features/public-form/components/FormEndPage/FormEndPage.tsx +++ b/frontend/src/features/public-form/components/FormEndPage/FormEndPage.tsx @@ -2,7 +2,10 @@ import { Container, Flex, Stack, StackDivider } from '@chakra-ui/react' import { FormColorTheme, FormDto } from '~shared/types/form' -import { SubmissionData } from '~features/public-form/PublicFormContext' +import { + SubmissionData, + usePublicFormContext, +} from '~features/public-form/PublicFormContext' import { EndPageBlock } from './components/EndPageBlock' import { FeedbackBlock, FeedbackFormInput } from './components/FeedbackBlock' @@ -23,6 +26,8 @@ export const FormEndPage = ({ colorTheme, ...endPageProps }: FormEndPageProps): JSX.Element => { + const { previousSubmissionId } = usePublicFormContext() + return ( @@ -39,6 +44,7 @@ export const FormEndPage = ({ focusOnMount {...endPageProps} colorTheme={colorTheme} + previousSubmissionId={previousSubmissionId} /> {isFeedbackSectionHidden ? null : ( { const focusRef = useRef(null) useEffect(() => { @@ -56,7 +55,6 @@ export const EndPageBlock = ({ return 'You have successfully submitted your response.' }, [formTitle]) - const { previousSubmissionId } = usePublicFormContext() const disableSubmitResponseButton = !!previousSubmissionId //disable for MRF 2nd respondent onwards return (