-
Notifications
You must be signed in to change notification settings - Fork 0
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 not found page #285
base: main
Are you sure you want to change the base?
Add not found page #285
Conversation
Please change the base to |
82db39d
to
8e0fb5b
Compare
import { IntlProvider } from "@src/app/[domain]/[language]/IntlProvider"; | ||
import { GQLLayoutQuery, GQLLayoutQueryVariables } from "@src/app/[domain]/[language]/layout.generated"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use relative import
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dba5772
to
efcea3b
Compare
efcea3b
to
a5708e8
Compare
/> | ||
</Typography> | ||
<Typography variant="p200"> | ||
<Link href={`/${language}`}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this link always work? Because of this code in layout.tsx:
if (!siteConfig.scope.languages.includes(language)) {
notFound();
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The layout uses the not found page of the layer above, so it falls back to the Next.js default:

We could also add an extra not found page for that. The problem is, we can't use FormattedMessage there because we have no IntlProvider since we don't know which language we are in.
Right now, we only have a not found page within the language scope. We could also add one for fallback which contains hardcoded English
Please consider #363 as additional context. |
@thomasdax98 what's the status here? |
60b8c01
to
0b0a138
Compare
…ing to ServerSideHeader component
0b0a138
to
41af0db
Compare
@johnnyomair I simplified it once more. Now it's ready from my perspective |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's odd that we need an additional component to fetch the header data for the non-internationalized not found page. Wouldn't it be better if the not found page fetched the header and passes it to the component, as we do in the layout?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I do that, I need to make the query in the not found page and in the layout. I wanted to avoid the code duplication, so I moved it to this shared component. I can't put it directly in the Header
since it's a client component.
Would you prefer the code duplication?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you prefer the code duplication?
I'm not sure. I'd prefer to have the solution that's the most easy to understand. It took me a while to understand your change.
Would it be possible to reuse the layout from /[domain]/[language]/layout.tsx in /[domain]/layout.tsx with a default language?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving (almost everything) from layout
to Header
might not be ideal: in real world applications the layout contains probably more than just a header, for example a footer.
PR Checklist
Screenshots/screencasts