-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #91 from SELab-2/81-custom-404-and-403-pages
81 custom 404 and 403 pages
- Loading branch information
Showing
7 changed files
with
75 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
export const metadata = { | ||
title: 'Next.js', | ||
description: 'Generated by Next.js', | ||
} | ||
|
||
export default function RootLayout({ | ||
children, | ||
}: { | ||
children: React.ReactNode | ||
}) { | ||
return ( | ||
<html lang="en"> | ||
<body>{children}</body> | ||
</html> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import NavBar from "@app/[locale]/components/NavBar"; | ||
import Typography from "@mui/material/Typography"; | ||
import Box from "@mui/material/Box"; | ||
import initTranslations from "@app/i18n"; | ||
import TranslationsProvider from "@app/[locale]/components/TranslationsProvider"; | ||
|
||
|
||
async function Page_404({params: {locale}}: { params: { locale: any } }) { | ||
const {t, resources} = await initTranslations(locale, ["common"]) | ||
|
||
return ( | ||
<TranslationsProvider | ||
resources={resources} | ||
locale={locale} | ||
namespaces={["common"]} | ||
> | ||
<NavBar/> | ||
<Box sx={{marginTop: '64px'}}> | ||
<Typography variant="h3"> | ||
{t("page_not_found")} | ||
</Typography> | ||
</Box> | ||
</TranslationsProvider> | ||
); | ||
} | ||
|
||
export default Page_404; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import NavBar from "@app/[locale]/components/NavBar"; | ||
import Typography from "@mui/material/Typography"; | ||
import Box from "@mui/material/Box"; | ||
import initTranslations from "@app/i18n"; | ||
import TranslationsProvider from "@app/[locale]/components/TranslationsProvider"; | ||
|
||
async function Page_403({params: {locale}}: { params: { locale: any } }) { | ||
const {t, resources} = await initTranslations(locale, ["common"]) | ||
|
||
return ( | ||
<TranslationsProvider | ||
resources={resources} | ||
locale={locale} | ||
namespaces={["common"]} | ||
> | ||
<NavBar/> | ||
<Box sx={{marginTop: '64px'}}> | ||
<Typography variant="h3"> | ||
{t("no_access_message")} | ||
</Typography> | ||
</Box> | ||
</TranslationsProvider> | ||
); | ||
} | ||
|
||
export default Page_403; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters