-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix up new pages with translations and meta
- Loading branch information
1 parent
d8bc746
commit 8e20429
Showing
6 changed files
with
49 additions
and
26 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,14 +1,29 @@ | ||
"use client"; | ||
import { Metadata } from "next"; | ||
|
||
import { useTranslations } from "next-intl"; | ||
import { getTranslations } from "next-intl/server"; | ||
import { GridContainer } from "@trussworks/react-uswds"; | ||
|
||
const Unauthorized = () => { | ||
import ServerErrorAlert from "src/components/ServerErrorAlert"; | ||
|
||
export async function generateMetadata() { | ||
const t = await getTranslations(); | ||
const meta: Metadata = { | ||
title: t("ErrorPages.generic_error.page_title"), | ||
description: t("Index.meta_description"), | ||
}; | ||
return meta; | ||
} | ||
|
||
// not a NextJS error page - this is here to be redirected to manually in cases | ||
// where Next's error handling situation doesn't quite do what we need. | ||
const TopLevelError = () => { | ||
const t = useTranslations("Errors"); | ||
return ( | ||
<GridContainer> | ||
<h3>Error</h3> | ||
<div>Oops, something went wrong. Please try again.</div> | ||
<ServerErrorAlert callToAction={t("try_again")} /> | ||
</GridContainer> | ||
); | ||
}; | ||
|
||
export default Unauthorized; | ||
export default TopLevelError; |
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
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