-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
69 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
VITE_API_BASE_URL=/mock | ||
VITE_YEAR=2024 | ||
VITE_UMAMI_WEBSITE_ID= | ||
VITE_FEEDBACK_FORM_URL= | ||
VITE_FEEDBACK_FORM_URL_PREFILL_ERROR_MESSAGE= |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,35 @@ | ||
import { Code, Link } from '@nextui-org/react'; | ||
import type { FallbackProps } from 'react-error-boundary'; | ||
|
||
import { useMount } from '../utils/mount'; | ||
|
||
export const Error = ({ error }: FallbackProps) => { | ||
const errorMessage = String(error); | ||
const prefilledFeedbackForm = `${import.meta.env.VITE_FEEDBACK_FORM_URL_PREFILL_ERROR_MESSAGE}+${errorMessage}%0ACause:+`; | ||
|
||
useMount(() => { | ||
// Clear local data to reset the app | ||
localStorage.clear(); | ||
}); | ||
|
||
return ( | ||
<div className="mx-2 flex h-dvh flex-col items-center justify-center gap-2"> | ||
<h1 className="text-4xl">Oops.. Something went wrong!</h1> | ||
<p> | ||
We're sorry, but we need to clear all saved data for this website | ||
(including any locally stored courses and times). | ||
</p> | ||
<Code size="lg" className="max-w-full overflow-x-auto p-2"> | ||
<span className="font-bold">Error Message:</span> <br /> | ||
{errorMessage} | ||
</Code> | ||
<p> | ||
Before refreshing the page, would you like to{' '} | ||
<Link isExternal href={prefilledFeedbackForm}> | ||
send us feedback | ||
</Link>{' '} | ||
along with the error message to help improve our app? | ||
</p> | ||
</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