diff --git a/app/root.tsx b/app/root.tsx index eec21a2..ae5daa3 100644 --- a/app/root.tsx +++ b/app/root.tsx @@ -89,7 +89,6 @@ export function ErrorBoundary({ error }: Route.ErrorBoundaryProps) { let message = "An unexpected error occurred. Please try again later."; let stack: string | undefined; let showSignInHint = false; - if (isRouteErrorResponse(error)) { status = error.status; switch (error.status) { @@ -119,15 +118,6 @@ export function ErrorBoundary({ error }: Route.ErrorBoundaryProps) { stack = import.meta.env.DEV ? error.stack : undefined; } - const StatusIcon = () => { - const cls = "h-14 w-14 text-muted-foreground"; - if (status === 401) return ; - if (status === 403) return ; - if (status === 404) return ; - if (status >= 500) return ; - return ; - }; - return (
@@ -145,7 +135,7 @@ export function ErrorBoundary({ error }: Route.ErrorBoundaryProps) {
- + {statusIcon(status)}
@@ -153,26 +143,21 @@ export function ErrorBoundary({ error }: Route.ErrorBoundaryProps) {

{message}

-
+
- Go Home + {showSignInHint ? "Go to Home Page to Sign In" : "Go Home"} - {showSignInHint && ( -

- You can sign in from the home page. -

- )}
{stack && ( -
- +
+ Stack trace (development only) -
+              
                 {stack}
               
@@ -182,3 +167,12 @@ export function ErrorBoundary({ error }: Route.ErrorBoundaryProps) {
); } + +function statusIcon(status: number) { + const cls = "h-14 w-14 text-muted-foreground"; + if (status === 401) return ; + if (status === 403) return ; + if (status === 404) return ; + if (status >= 500) return ; + return ; +}