️(frontend) Set page titles for 403 and 404 errors

Set the page titles for the 403 and 404 error
pages to improve user experience and accessibility.
This commit is contained in:
Appryll
2025-06-03 13:48:45 +02:00
committed by Anthony LC
parent 0fd16b4371
commit 4fc49d5cb2
2 changed files with 78 additions and 52 deletions

View File

@@ -1,4 +1,5 @@
import { Button } from '@openfun/cunningham-react'; import { Button } from '@openfun/cunningham-react';
import Head from 'next/head';
import Image from 'next/image'; import Image from 'next/image';
import { ReactElement } from 'react'; import { ReactElement } from 'react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
@@ -17,6 +18,17 @@ const Page: NextPageWithLayout = () => {
const { t } = useTranslation(); const { t } = useTranslation();
return ( return (
<>
<Head>
<title>
{t('Access Denied - Error 403')} - {t('Docs')}
</title>
<meta
property="og:title"
content={`${t('Access Denied - Error 403')} - ${t('Docs')}`}
key="title"
/>
</Head>
<Box <Box
$align="center" $align="center"
$margin="auto" $margin="auto"
@@ -45,6 +57,7 @@ const Page: NextPageWithLayout = () => {
</StyledLink> </StyledLink>
</Box> </Box>
</Box> </Box>
</>
); );
}; };

View File

@@ -1,4 +1,5 @@
import { Button } from '@openfun/cunningham-react'; import { Button } from '@openfun/cunningham-react';
import Head from 'next/head';
import Image from 'next/image'; import Image from 'next/image';
import { ReactElement } from 'react'; import { ReactElement } from 'react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
@@ -17,6 +18,17 @@ const Page: NextPageWithLayout = () => {
const { t } = useTranslation(); const { t } = useTranslation();
return ( return (
<>
<Head>
<title>
{t('Page Not Found - Error 404')} - {t('Docs')}
</title>
<meta
property="og:title"
content={`${t('Page Not Found - Error 404')} - ${t('Docs')}`}
key="title"
/>
</Head>
<Box <Box
$align="center" $align="center"
$margin="auto" $margin="auto"
@@ -47,6 +59,7 @@ const Page: NextPageWithLayout = () => {
</StyledLink> </StyledLink>
</Box> </Box>
</Box> </Box>
</>
); );
}; };