diff --git a/apps/webapp/app/components/layout/AppLayout.tsx b/apps/webapp/app/components/layout/AppLayout.tsx index ebdfe41ff..2f86a81bb 100644 --- a/apps/webapp/app/components/layout/AppLayout.tsx +++ b/apps/webapp/app/components/layout/AppLayout.tsx @@ -8,12 +8,26 @@ export function AppContainer({ }: { children: React.ReactNode; showBackgroundGradient?: boolean; +}) { + return ( + +
+ {children} +
+
+ ); +} + +export function BackgroundGradient({ + children, + showBackgroundGradient, +}: { + children: React.ReactNode; + showBackgroundGradient?: boolean; }) { return (
{ return [{ rel: "stylesheet", href: tailwindStylesheetUrl }]; @@ -54,8 +63,9 @@ export const shouldRevalidate: ShouldRevalidateFunction = (options) => { return true; }; -export function ErrorBoundary({ error }: { error: any }) { - console.error(error); +export function ErrorBoundary() { + const error = useRouteError(); + return ( @@ -63,22 +73,50 @@ export function ErrorBoundary({ error }: { error: any }) { - -
-
-

Oh no!

- {JSON.stringify(error)} - - Back home - -
- + +
+ +
+ +
+ {isRouteErrorResponse(error) ? ( + + ) : error instanceof Error ? ( + + ) : ( + + )} +
+
+
+ ); } +function ErrorDisplay({ title, message }: { title: string; message?: string }) { + return ( +
+ {title} + {message && {message}} + + Home + +
+ ); +} + function App() { const { toastMessage, posthogProjectKey } = useTypedLoaderData(); @@ -108,7 +146,7 @@ function App() { - +