Skip to content

Commit 7ca9d5a

Browse files
committed
Update Not Found page to check internet connection
1 parent 4afc7c1 commit 7ca9d5a

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

src/app/components/pages/NotFound.tsx

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ const buildContactUrl = (state: {overridePathname?: string}, pathname: string) =
1212
export const NotFound = () => {
1313
const {pathname, state} = useLocation<{overridePathname?: string}>();
1414
return <Container>
15-
<div>
15+
<div className="pb-1">
1616
<TitleAndBreadcrumb
1717
breadcrumbTitleOverride={siteSpecific("Unknown page", "404")}
18-
currentPageTitle="Page not found"
18+
currentPageTitle={window.navigator.onLine ? "Page not found" : "No internet"}
1919
icon={{type: "hex", icon: "icon-error"}}
2020
/>
2121
<p className="my-4">
@@ -24,12 +24,18 @@ export const NotFound = () => {
2424
{(state && state.overridePathname) || pathname}
2525
</code>
2626
</p>
27-
<p>
28-
Expecting to find something here?
29-
<a className="ps-1" href={buildContactUrl(state, pathname)} >
30-
Let us know<span className="visually-hidden"> about this missing page</span>
31-
</a>.
32-
</p>
27+
28+
{window.navigator.onLine ?
29+
<p>
30+
Expecting to find something here?
31+
<a className="ps-1" href={buildContactUrl(state, pathname)} >
32+
Let us know<span className="visually-hidden"> about this missing page</span>
33+
</a>.
34+
</p> :
35+
<p>
36+
It looks like you&apos;re offline. Please check your internet connection.
37+
</p>
38+
}
3339
</div>
3440
</Container>;
3541
};

0 commit comments

Comments
 (0)