Skip to content

Commit 6adbbb2

Browse files
Improve error component copy (#7362)
1 parent daadece commit 6adbbb2

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

packages/web/app/src/components/error.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ import { Button } from '@/components/ui/button';
55
import { captureException, flush } from '@sentry/react';
66
import { useRouter } from '@tanstack/react-router';
77

8+
export const commonErrorStrings = {
9+
reported: 'This error was reported automatically to our technical support team.',
10+
track: 'To share additional details with us, contact our support team',
11+
link: 'here',
12+
};
13+
814
export function ErrorComponent(props: { error: any; message?: string }) {
915
const router = useRouter();
1016
const session = useSessionContext();
@@ -39,11 +45,11 @@ export function ErrorComponent(props: { error: any; message?: string }) {
3945
</h1>
4046
<div className="mt-2">
4147
<div className="text-sm">
42-
<p>Don't worry, our technical support got this error reported automatically.</p>
48+
<p>{commonErrorStrings.reported}</p>
4349
<p>
44-
If you wish to track it later or share more details with us,{' '}
50+
{commonErrorStrings.track}{' '}
4551
<Button variant="link" className="h-auto p-0 text-orange-500" asChild>
46-
<a href="mailto:support@graphql-hive.com">you can use the support</a>
52+
<a href="mailto:support@graphql-hive.com">{commonErrorStrings.link}</a>
4753
</Button>
4854
.
4955
</p>

packages/web/app/src/components/ui/query-error.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { ReactElement } from 'react';
22
import cookies from 'js-cookie';
33
import { LogOutIcon } from 'lucide-react';
44
import { CombinedError } from 'urql';
5+
import { commonErrorStrings } from '@/components/error';
56
import { Button } from '@/components/ui/button';
67
import { LAST_VISITED_ORG_KEY } from '@/constants';
78
import { Link, useRouter } from '@tanstack/react-router';
@@ -54,18 +55,18 @@ export function QueryError({
5455
<div className="text-sm">{error.graphQLErrors?.[0].message}</div>
5556
) : (
5657
<div className="text-sm">
57-
<p>Don't worry, our technical support got this error reported automatically.</p>
58+
<p>{commonErrorStrings.reported}</p>
5859
<p>
59-
If you wish to track it later or share more details with us,{' '}
60+
{commonErrorStrings.track}{' '}
6061
{organizationSlug ? (
6162
<Button variant="link" className="h-auto p-0 text-orange-500" asChild>
6263
<Link to="/$organizationSlug/view/support" params={{ organizationSlug }}>
63-
you can use the support
64+
{commonErrorStrings.link}
6465
</Link>
6566
</Button>
6667
) : (
6768
<Button variant="link" className="h-auto p-0 text-orange-500" asChild>
68-
<a href="mailto:support@graphql-hive.com">you can use the support</a>
69+
<a href="mailto:support@graphql-hive.com">{commonErrorStrings.link}</a>
6970
</Button>
7071
)}
7172
.

0 commit comments

Comments
 (0)