-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert '404' page to App Router [#134]
Also updates the 404 content test to match the new behavior of not returning the full page. Note: file renaming (`404.jsx` -> `not-found.tsx`) is because Next.js App Router requires the latter name. Note: old `pages/404.jsx` and `src/pages/404.jsx` are left in place because the `ListResources` component depends on the `ErrorContainer` style being exported from them. This will be addressed in a subsequent commit.
- Loading branch information
Showing
4 changed files
with
32 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import React from "react"; | ||
|
||
import styles from "./styles/not-found.module.css"; | ||
|
||
export default function FourOhFour(): React.ReactElement { | ||
return ( | ||
<> | ||
<div className={styles.errorContainer}> | ||
Oops - that page doesn’t exist! (404). | ||
<br /> | ||
Maybe start again with <a href="/">our main page</a>? | ||
</div> | ||
</> | ||
); | ||
} |
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 |
---|---|---|
|
@@ -15,6 +15,7 @@ | |
|
||
--blue: #5097ba; | ||
--darkGrey: #333; | ||
--errorRed: #DE3C26; | ||
--mediumGrey: #888; | ||
--lightGrey: #ccc; | ||
|
||
|
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,15 @@ | ||
.errorContainer { | ||
color: var(--errorRed); | ||
font-size: 28px; | ||
font-weight: 300; | ||
line-height: calc(1.4 * var(--niceLineHeight)); | ||
margin: 0 auto; | ||
max-width: 640px; | ||
padding: 130px 0 80px; | ||
text-align: center; | ||
} | ||
|
||
.errorContainer a { | ||
color: var(--errorRed); | ||
text-decoration: underline; | ||
} |
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