Skip to content

Commit 4866acd

Browse files
committed
chore(core): add root level not-found page
1 parent b435d3c commit 4866acd

2 files changed

Lines changed: 36 additions & 0 deletions

File tree

.changeset/large-trams-rule.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@bigcommerce/catalyst-core": patch
3+
---
4+
5+
Adds a root level not-found page for scenarios where a redirect to `notFound` is used outside the `[locale]` path.

core/app/not-found.tsx

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { clsx } from 'clsx';
2+
import { getTranslations } from 'next-intl/server';
3+
4+
import '../globals.css';
5+
6+
import { SectionLayout } from '@/vibes/soul/sections/section-layout';
7+
import { fonts } from '~/app/fonts';
8+
import { defaultLocale } from '~/i18n/locales';
9+
10+
export default async function NotFound() {
11+
const t = await getTranslations({ namespace: 'NotFound', locale: defaultLocale });
12+
13+
return (
14+
<html className={clsx(fonts.map((f) => f.variable))} lang={defaultLocale}>
15+
<body className="flex min-h-screen flex-col">
16+
<div className="flex flex-1 flex-col place-content-center">
17+
<SectionLayout containerSize="2xl">
18+
<header className="font-[family-name:var(--not-found-font-family,var(--font-family-body))]">
19+
<h1 className="mb-3 font-[family-name:var(--not-found-title-font-family,var(--font-family-heading))] text-3xl font-medium leading-none text-[var(--not-found-title,hsl(var(--foreground)))] @xl:text-4xl @4xl:text-5xl">
20+
{t('title')}
21+
</h1>
22+
<p className="mb-4 text-lg text-[var(--not-found-subtitle,hsl(var(--contrast-500)))]">
23+
{t('subtitle')}
24+
</p>
25+
</header>
26+
</SectionLayout>
27+
</div>
28+
</body>
29+
</html>
30+
);
31+
}

0 commit comments

Comments
 (0)