Skip to content

Commit 8fd7b61

Browse files
authored
Merge pull request #8921 from opengovsg/feat/noindex-on-router
feat(robots): add noindex on page router to avoid reliance on thirdparty
1 parent 3d67515 commit 8fd7b61

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

frontend/src/app/AppRouter.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Suspense, useEffect } from 'react'
2+
import { Helmet } from 'react-helmet-async'
23
import { Route, Routes } from 'react-router-dom'
34
import { Box } from '@chakra-ui/react'
45
import { useGrowthBook } from '@growthbook/growthbook-react'
@@ -165,9 +166,14 @@ export const AppRouter = (): JSX.Element => {
165166
<Route
166167
path={EDIT_SUBMISSION_PAGE_SUBROUTE}
167168
element={
168-
<ParamIdValidator
169-
element={<PublicElement element={<PublicFormPage />} />}
170-
/>
169+
<>
170+
<Helmet>
171+
<meta name="robots" content="noindex,nofollow" />
172+
</Helmet>
173+
<ParamIdValidator
174+
element={<PublicElement element={<PublicFormPage />} />}
175+
/>
176+
</>
171177
}
172178
/>
173179
<Route

0 commit comments

Comments
 (0)