* init Signed-off-by: Innei <i@innei.in> * chore: utils import Signed-off-by: Innei <tukon479@gmail.com> * remove stable router Signed-off-by: Innei <tukon479@gmail.com> * refactor: components import Signed-off-by: Innei <tukon479@gmail.com> * chore: auto-fix linting and formatting issues * minify Signed-off-by: Innei <tukon479@gmail.com> * update Signed-off-by: Innei <tukon479@gmail.com> * fix: test Signed-off-by: Innei <tukon479@gmail.com> * chore: ui component extract Signed-off-by: Innei <tukon479@gmail.com> * fix: import Signed-off-by: Innei <tukon479@gmail.com> * re-render Signed-off-by: Innei <tukon479@gmail.com> * refactor: remove hooks Signed-off-by: Innei <tukon479@gmail.com> * fix Signed-off-by: Innei <tukon479@gmail.com> * update Signed-off-by: Innei <tukon479@gmail.com> * setting Signed-off-by: Innei <tukon479@gmail.com> * update Signed-off-by: Innei <tukon479@gmail.com> * refactor: remove icons Signed-off-by: Innei <i@innei.in> * typings Signed-off-by: Innei <i@innei.in> * feat: add horizontal scroll functionality to TimelineTabs (#1081) Co-authored-by: xhuajin <xhuajin@users.noreply.github.com> Co-authored-by: Stephen Zhou <38493346+hyoban@users.noreply.github.com> * fix: Wrong initial position of tab animation (#1087) Co-authored-by: hamster1963 <hamster1963@users.noreply.github.com> * fix: disable auto toggle readability in web * fix: margin condition in EntryListHeader (#1103) * chore(i18n): add daily reward system translation (#1102) Co-authored-by: lc4t <lc4t@users.noreply.github.com> * fix: deps Signed-off-by: Innei <i@innei.in> * fix: type Signed-off-by: Innei <i@innei.in> * update Signed-off-by: Innei <i@innei.in> * fix Signed-off-by: Innei <i@innei.in> --------- Signed-off-by: Innei <i@innei.in> Signed-off-by: Innei <tukon479@gmail.com> Co-authored-by: Innei <Innei@users.noreply.github.com> Co-authored-by: Huajin <114134574+xhuajin@users.noreply.github.com> Co-authored-by: xhuajin <xhuajin@users.noreply.github.com> Co-authored-by: Stephen Zhou <38493346+hyoban@users.noreply.github.com> Co-authored-by: 仓鼠 <71394853+hamster1963@users.noreply.github.com> Co-authored-by: hamster1963 <hamster1963@users.noreply.github.com> Co-authored-by: Konv Suu <2583695112@qq.com> Co-authored-by: lc4t <11334449+lc4t@users.noreply.github.com> Co-authored-by: lc4t <lc4t@users.noreply.github.com>
48 lines
1.7 KiB
TypeScript
48 lines
1.7 KiB
TypeScript
import { Button } from "@follow/components/ui/button/index.js"
|
|
import type { FC } from "react"
|
|
|
|
import { attachOpenInEditor } from "~/lib/dev"
|
|
|
|
import type { AppErrorFallbackProps } from "../common/AppErrorBoundary"
|
|
import { FeedbackIssue } from "../common/ErrorElement"
|
|
import { parseError, useResetErrorWhenRouteChange } from "./helper"
|
|
|
|
const PageErrorFallback: FC<AppErrorFallbackProps> = (props) => {
|
|
const { message, stack } = parseError(props.error)
|
|
useResetErrorWhenRouteChange(props.resetError)
|
|
return (
|
|
<div className="flex w-full flex-col items-center justify-center rounded-md bg-theme-modal-background-opaque p-2">
|
|
<div className="m-auto max-w-prose text-center">
|
|
<div className="mb-4">
|
|
<i className="i-mgc-bug-cute-re text-4xl text-red-500" />
|
|
</div>
|
|
<div className="text-lg font-bold">{message}</div>
|
|
{import.meta.env.DEV && stack ? (
|
|
<pre className="mt-4 max-h-48 cursor-text select-text overflow-auto whitespace-pre-line rounded-md bg-red-50 p-4 text-left font-mono text-sm text-red-600">
|
|
{attachOpenInEditor(stack)}
|
|
</pre>
|
|
) : null}
|
|
|
|
<p className="my-8">
|
|
{APP_NAME} has a temporary problem, click the button below to try reloading the app or
|
|
another solution?
|
|
</p>
|
|
|
|
<div className="center gap-4">
|
|
<Button onClick={() => props.resetError()} variant="primary">
|
|
Retry
|
|
</Button>
|
|
|
|
<Button onClick={() => window.location.reload()} variant="outline">
|
|
Reload
|
|
</Button>
|
|
</div>
|
|
|
|
<FeedbackIssue message={message!} stack={stack} />
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default PageErrorFallback
|