diff --git a/apps/web/app/(marketing)/changelog/[slug]/page.tsx b/apps/web/app/(marketing)/changelog/[slug]/page.tsx index 5a700a790..5aae60cfa 100644 --- a/apps/web/app/(marketing)/changelog/[slug]/page.tsx +++ b/apps/web/app/(marketing)/changelog/[slug]/page.tsx @@ -72,10 +72,10 @@ export async function generateMetadata({ url: data.entry.url, images: image ? [ - { - url: image, - }, - ] + { + url: image, + }, + ] : [], }, twitter: { diff --git a/apps/web/app/error.tsx b/apps/web/app/error.tsx index f64335eb6..0fd615f64 100644 --- a/apps/web/app/error.tsx +++ b/apps/web/app/error.tsx @@ -1,16 +1,10 @@ 'use client'; -import Link from 'next/link'; - -import { ArrowLeft, MessageCircle } from 'lucide-react'; - import { useCaptureException } from '@kit/monitoring/hooks'; import { useUser } from '@kit/supabase/hooks/use-user'; -import { Button } from '@kit/ui/button'; -import { Heading } from '@kit/ui/heading'; -import { Trans } from '@kit/ui/trans'; import { SiteHeader } from '~/(marketing)/_components/site-header'; +import { ErrorPageContent } from '~/components/error-page-content'; const ErrorPage = ({ error, @@ -27,53 +21,13 @@ const ErrorPage = ({
-
-
-
-

- -

-
- -
-
-
- - - -
- -

- -

-
- -
- - - -
-
-
-
+
); }; diff --git a/apps/web/app/global-error.tsx b/apps/web/app/global-error.tsx index afb172435..c87bd5eca 100644 --- a/apps/web/app/global-error.tsx +++ b/apps/web/app/global-error.tsx @@ -1,16 +1,10 @@ 'use client'; -import Link from 'next/link'; - -import { ArrowLeft, MessageCircle } from 'lucide-react'; - import { useCaptureException } from '@kit/monitoring/hooks'; import { useUser } from '@kit/supabase/hooks/use-user'; -import { Button } from '@kit/ui/button'; -import { Heading } from '@kit/ui/heading'; -import { Trans } from '@kit/ui/trans'; import { SiteHeader } from '~/(marketing)/_components/site-header'; +import { ErrorPageContent } from '~/components/error-page-content'; import { RootProviders } from '~/components/root-providers'; const GlobalErrorPage = ({ @@ -40,53 +34,13 @@ function GlobalErrorContent({ reset }: { reset: () => void }) {
-
-
-
-

- -

-
- -
-
-
- - - -
- -

- -

-
- -
- - - -
-
-
-
+
); } diff --git a/apps/web/app/not-found.tsx b/apps/web/app/not-found.tsx index ea0aa6508..60573fb67 100644 --- a/apps/web/app/not-found.tsx +++ b/apps/web/app/not-found.tsx @@ -1,14 +1,4 @@ -import Link from 'next/link'; - -import { ArrowLeft } from 'lucide-react'; - -import { requireUser } from '@kit/supabase/require-user'; -import { getSupabaseServerClient } from '@kit/supabase/server-client'; -import { Button } from '@kit/ui/button'; -import { Heading } from '@kit/ui/heading'; -import { Trans } from '@kit/ui/trans'; - -import { SiteHeader } from '~/(marketing)/_components/site-header'; +import { ErrorPageContent } from '~/components/error-page-content'; import { createI18nServerInstance } from '~/lib/i18n/i18n.server'; import { withI18n } from '~/lib/i18n/with-i18n'; @@ -22,48 +12,13 @@ export const generateMetadata = async () => { }; const NotFoundPage = async () => { - const client = getSupabaseServerClient(); - const user = await requireUser(client, { verifyMfa: false }); - return (
- - -
-
-
-

- -

-
- -
-
-
- - - -
- -

- -

-
- - -
-
-
+
); }; diff --git a/apps/web/components/error-page-content.tsx b/apps/web/components/error-page-content.tsx new file mode 100644 index 000000000..960b8190c --- /dev/null +++ b/apps/web/components/error-page-content.tsx @@ -0,0 +1,88 @@ +'use client'; + +import Link from 'next/link'; + +import { ArrowLeft, MessageCircleQuestion } from 'lucide-react'; + +import { Button } from '@kit/ui/button'; +import { Trans } from '@kit/ui/trans'; + +export function ErrorPageContent({ + statusCode, + heading, + subtitle, + reset, + backLink = '/', + backLabel = 'common:backToHomePage', + contactLabel = 'common:contactUs', +}: { + statusCode: string; + heading: string; + subtitle: string; + reset?: () => void; + backLink?: string; + backLabel?: string; + contactLabel?: string; +}) { + return ( +
+ + +
+

+ +

+ +

+ +

+ +
+ {reset ? ( + + ) : ( + + )} + + +
+
+
+ ); +} diff --git a/apps/web/public/locales/en/common.json b/apps/web/public/locales/en/common.json index ba269a664..5cde4ff6f 100644 --- a/apps/web/public/locales/en/common.json +++ b/apps/web/public/locales/en/common.json @@ -18,14 +18,14 @@ "cancel": "Cancel", "clear": "Clear", "notFound": "Not Found", - "backToHomePage": "Back to Home Page", - "goBack": "Go Back", + "backToHomePage": "Back to Home", + "goBack": "Try Again", "genericServerError": "Sorry, something went wrong.", "genericServerErrorHeading": "Sorry, something went wrong while processing your request. Please contact us if the issue persists.", - "pageNotFound": "Sorry, this page does not exist.", - "pageNotFoundSubHeading": "Apologies, the page you were looking for was not found", - "genericError": "Sorry, something went wrong.", - "genericErrorSubHeading": "Apologies, an error occurred while processing your request. Please contact us if the issue persists.", + "pageNotFound": "Page not found", + "pageNotFoundSubHeading": "The page you're looking for doesn't exist or has been moved. Check the URL or head back to the homepage.", + "genericError": "Something went wrong", + "genericErrorSubHeading": "We ran into an unexpected issue. Please try again, and if the problem persists, reach out to our support team.", "anonymousUser": "Anonymous", "tryAgain": "Try Again", "theme": "Theme", @@ -48,8 +48,8 @@ "pageOfPages": "Page {{page}} of {{total}}", "showingRecordCount": "Showing {{pageSize}} of {{totalCount}} rows", "noData": "No data available", - "pageNotFoundHeading": "Ouch! :|", - "errorPageHeading": "Ouch! :|", + "pageNotFoundHeading": "404", + "errorPageHeading": "500", "notifications": "Notifications", "noNotifications": "No notifications", "justNow": "Just now", diff --git a/package.json b/package.json index 50bce2df5..7bfa9c71b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "next-supabase-saas-kit-turbo", - "version": "2.23.13", + "version": "2.23.14", "private": true, "sideEffects": false, "engines": {