Skip to content

Commit

Permalink
Merge branch 'main' into 23-heart-button-interactivity
Browse files Browse the repository at this point in the history
  • Loading branch information
root authored and root committed Dec 20, 2023
2 parents 20117ed + 36d102d commit 8665fa1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ dist-ssr
*.njsproj
*.sln
*.sw?

# Local Netlify folder
.netlify
2 changes: 2 additions & 0 deletions public/_redirects
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* /index.html 200

15 changes: 11 additions & 4 deletions src/views/ErrorPage/NotFoundPage.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
import { useRouteError } from 'react-router-dom'

type TError = {
statusText: string
message: string
}

export default function NotFoundPage() {
const error: Record<string, string> | unknown = useRouteError()
const error = useRouteError() as TError
console.error(error)

return (
<div id="error-page">
<h1>Oops!</h1>
<p>Sorry, an unexpected error has occurred.</p>
<p>
<i>{error.statusText || error.message}</i>
</p>
{error && (
<p>
<i>{error?.statusText || error?.message}</i>
</p>
)}
</div>
)
}

0 comments on commit 8665fa1

Please sign in to comment.