-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Error boundary and 404 page added (#27)
Fixes # # Description Added a catch-all route as the 404 page Added a root error boundary Changed i18next backended to the more popular alternative ## Type of change Please mark relevant options with an `x` in the brackets. - [ ] Bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] This change requires a documentation update - [ ] Algorithm update - updates algorithm documentation/questions/answers etc. - [ ] Other (please describe): # How Has This Been Tested? Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration - [ ] Integration tests - [ ] Unit tests - [x] Manual tests - [ ] No tests required # Reviewer checklist Mark everything that needs to be checked before merging the PR. - [ ] Check if the UI is working as expected and is satisfactory - [ ] Check if the code is well documented - [ ] Check if the behavior is what is expected - [ ] Check if the code is well tested - [ ] Check if the code is readable and well formatted - [ ] Additional checks (document below if any) # Screenshots (if appropriate): # Questions (if appropriate):
- Loading branch information
1 parent
deee689
commit e23ce5d
Showing
14 changed files
with
836 additions
and
813 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,7 +1,7 @@ | ||
// This file is generated by icon spritesheet generator | ||
|
||
export const iconNames = [ | ||
"ShoppingCart", | ||
"Ghost", | ||
] as const | ||
|
||
export type IconName = typeof iconNames[number] |
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { useTranslation } from "react-i18next" | ||
import { Link, useNavigate } from "react-router" | ||
import { Icon } from "~/library/icon/Icon" | ||
|
||
export default function Route404() { | ||
const navigate = useNavigate() | ||
const { t } = useTranslation() | ||
|
||
return ( | ||
<div className="min-h-screen bg-gradient-to-b from-gray-50 to-gray-100 flex items-center justify-center p-4"> | ||
<div className="max-w-2xl w-full text-center"> | ||
<div className="mb-8 flex justify-center"> | ||
<Icon name="Ghost" className="h-24 w-24 text-indigo-600 animate-float" /> | ||
</div> | ||
|
||
<h1 className="text-6xl font-bold text-gray-900 mb-4">404</h1> | ||
<h2 className="text-3xl font-semibold text-gray-800 mb-4">{t("error.404.title")}</h2> | ||
<p className="text-gray-600 mb-8 text-lg">{t("error.404.description")}</p> | ||
|
||
<div className="flex flex-col sm:flex-row gap-4 justify-center"> | ||
<button | ||
type="button" | ||
onClick={() => navigate(-1)} | ||
className="inline-flex cursor-pointer items-center justify-center px-6 py-3 border border-transparent text-base font-medium rounded-md text-indigo-700 bg-indigo-100 hover:bg-indigo-200 transition-colors duration-300" | ||
> | ||
{t("navigation.back")} | ||
</button> | ||
<Link | ||
to="/" | ||
className="inline-flex cursor-pointer items-center justify-center px-6 py-3 border border-transparent text-base font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 transition-colors duration-300" | ||
> | ||
{t("navigation.home")} | ||
</Link> | ||
</div> | ||
</div> | ||
</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
Oops, something went wrong.