-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed network select dropdown interaction and add custom 404 pages
- Loading branch information
Showing
13 changed files
with
89 additions
and
54 deletions.
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
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
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
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
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
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
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 |
---|---|---|
@@ -1,20 +1,31 @@ | ||
import { asError } from '@/utils/error' | ||
import { useRouteError } from 'react-router-dom' | ||
import { asError, is404 } from '@/utils/error' | ||
import { Link, useRouteError } from 'react-router-dom' | ||
import { PageTitle } from '../components/page-title' | ||
import { useSelectedNetwork } from '@/features/network/data' | ||
import { UrlTemplateObj } from '@/routes/url-template' | ||
|
||
type ErrorPageProps = { | ||
title?: string | ||
redirectUrl?: UrlTemplateObj<unknown> | ||
} | ||
|
||
export function ErrorPage({ title }: ErrorPageProps) { | ||
export function ErrorPage({ title, redirectUrl }: ErrorPageProps) { | ||
const error = asError(useRouteError()) | ||
|
||
const [selectedNetwork] = useSelectedNetwork() | ||
return ( | ||
<> | ||
<PageTitle title={title ?? 'Error'} /> | ||
<div> | ||
<p>Error: {error.message}</p> | ||
</div> | ||
{is404(error) && redirectUrl && ( | ||
<div className="mt-4"> | ||
<p>Are you sure you have the correct network selected?</p> | ||
<Link to={redirectUrl.build({ networkId: selectedNetwork })} className="text-primary hover:underline"> | ||
Go to main feature page | ||
</Link> | ||
</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
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
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
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
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
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