Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add basic 404. #247

Merged
merged 1 commit into from
Mar 9, 2023
Merged

Add basic 404. #247

merged 1 commit into from
Mar 9, 2023

Conversation

mathewjordan
Copy link
Member

@mathewjordan mathewjordan commented Feb 20, 2023

What does this do?

This work adds a basic custom 404 page. The page is basically just reusing the Hero component on the homepage to render a single slide. Additionally, it adds navigation to the end user to direct them back to actual content.

The image itself can be easily swapped out by adjusting a IIIF thumbnail on the pageNotFoundCollection object at lib/constants/404.ts if we decided on different one.

I also fixed a small bug in the HeroBasic component where the bgImage prop does not drill down as expected to some inline CSS. This was notice when working through an initial idea.

image

@mathewjordan mathewjordan marked this pull request as draft February 20, 2023 21:04
@mathewjordan mathewjordan self-assigned this Feb 21, 2023
@mathewjordan mathewjordan marked this pull request as ready for review February 21, 2023 13:36
Copy link
Contributor

@adamjarling adamjarling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks and works great. One thing to maybe consider? Say I'm at a Work page, or Collection page and mistype the id or any dynamic route id. Should the 404 kick in, or some note that the id item doesn't exist? Currently it returns this...

image

Copy link
Contributor

@adamjarling adamjarling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks and works great.

@@ -203,6 +203,11 @@ export const getServerSideProps: GetServerSideProps = async (context) => {
const id = context?.params?.id;
const collection = await getCollection(id as string);

if (typeof collection === "undefined")
return {
notFound: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Nice and easy

@mathewjordan mathewjordan merged commit d0e7783 into deploy/staging Mar 9, 2023
@mathewjordan mathewjordan deleted the preview/3587-404 branch March 9, 2023 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants