Skip to content

Commit 8de181d

Browse files
nperez0111YousefEDmatthewlipski
authored
docs: update analytics event tracking & pricing page (#2022)
Co-authored-by: Nick Perez <[email protected]> Co-authored-by: Yousef <[email protected]> Co-authored-by: Matthew Lipski <[email protected]>
1 parent a87ac38 commit 8de181d

File tree

23 files changed

+372
-78
lines changed

23 files changed

+372
-78
lines changed

docs/app/(home)/layout.tsx

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,30 @@ import type { ReactNode } from "react";
22
import { HomeLayout } from "fumadocs-ui/layouts/home";
33
import { baseOptions } from "@/app/layout.config";
44
import { Footer } from "@/components/Footer";
5+
import * as Sentry from "@sentry/nextjs";
56

67
export default function Layout({ children }: { children: ReactNode }) {
78
return (
89
<>
9-
<HomeLayout {...baseOptions}>{children}</HomeLayout>
10+
<HomeLayout {...baseOptions}>
11+
<Sentry.ErrorBoundary
12+
fallback={
13+
<div>
14+
We encountered an error trying to show this page. Please report
15+
this to us on GitHub at{" "}
16+
<a href="https://github.com/TypeCellOS/BlockNote/issues">
17+
https://github.com/TypeCellOS/BlockNote/issues
18+
</a>
19+
</div>
20+
}
21+
beforeCapture={(scope) => {
22+
scope.setTag("type", "react-render");
23+
scope.setTag("page", "home");
24+
}}
25+
>
26+
{children}
27+
</Sentry.ErrorBoundary>
28+
</HomeLayout>
1029
<Footer />
1130
</>
1231
);

docs/app/about/layout.tsx

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,30 @@ import { HomeLayout } from "fumadocs-ui/layouts/home";
22
import type { ReactNode } from "react";
33
import { baseOptions } from "@/app/layout.config";
44
import { Footer } from "@/components/Footer";
5+
import * as Sentry from "@sentry/nextjs";
56

67
export default function Layout({ children }: { children: ReactNode }) {
78
return (
89
<>
9-
<HomeLayout {...baseOptions}>{children}</HomeLayout>
10+
<HomeLayout {...baseOptions}>
11+
<Sentry.ErrorBoundary
12+
fallback={
13+
<div>
14+
We encountered an error trying to show this page. Please report
15+
this to us on GitHub at{" "}
16+
<a href="https://github.com/TypeCellOS/BlockNote/issues">
17+
https://github.com/TypeCellOS/BlockNote/issues
18+
</a>
19+
</div>
20+
}
21+
beforeCapture={(scope) => {
22+
scope.setTag("type", "react-render");
23+
scope.setTag("page", "about");
24+
}}
25+
>
26+
{children}
27+
</Sentry.ErrorBoundary>
28+
</HomeLayout>
1029
<Footer />
1130
</>
1231
);

docs/app/docs/layout.tsx

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,33 @@
1-
import type { ReactNode } from "react";
2-
import { Analytics } from "@vercel/analytics/react";
31
import { baseOptions } from "@/app/layout.config";
42
import { CustomDocsLayout } from "@/components/CustomDocsLayout";
53
import { Footer } from "@/components/Footer";
64
import { source } from "@/lib/source/docs";
5+
import type { ReactNode } from "react";
6+
import * as Sentry from "@sentry/nextjs";
77

88
export default function Layout({ children }: { children: ReactNode }) {
99
return (
1010
<>
1111
<CustomDocsLayout tree={source.pageTree} {...baseOptions}>
12-
{children}
12+
<Sentry.ErrorBoundary
13+
fallback={
14+
<div>
15+
We encountered an error trying to show this page. Please report
16+
this to us on GitHub at{" "}
17+
<a href="https://github.com/TypeCellOS/BlockNote/issues">
18+
https://github.com/TypeCellOS/BlockNote/issues
19+
</a>
20+
</div>
21+
}
22+
beforeCapture={(scope) => {
23+
scope.setTag("type", "react-render");
24+
scope.setTag("page", "docs");
25+
}}
26+
>
27+
{children}
28+
</Sentry.ErrorBoundary>
1329
</CustomDocsLayout>
1430
<Footer />
15-
<Analytics />
1631
</>
1732
);
1833
}

docs/app/examples/layout.tsx

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import type { ReactNode } from "react";
2-
import { Analytics } from "@vercel/analytics/react";
31
import { baseOptions } from "@/app/layout.config";
42
import { CustomDocsLayout } from "@/components/CustomDocsLayout";
53
import { Footer } from "@/components/Footer";
64
import { ProBadge } from "@/components/ProBadge";
75
import { source } from "@/lib/source/examples";
86
import { getExampleData } from "@/util/getExampleData";
7+
import type { ReactNode } from "react";
8+
import * as Sentry from "@sentry/nextjs";
99

1010
export default function Layout({ children }: { children: ReactNode }) {
1111
// Add Pro badges to example pages in sidebar.
@@ -22,7 +22,7 @@ export default function Layout({ children }: { children: ReactNode }) {
2222

2323
page.name = (
2424
<span>
25-
{exampleData.title}
25+
<span className="mr-1">{exampleData.title}</span>
2626
{exampleData.isPro && <ProBadge />}
2727
</span>
2828
);
@@ -34,10 +34,25 @@ export default function Layout({ children }: { children: ReactNode }) {
3434
return (
3535
<>
3636
<CustomDocsLayout tree={source.pageTree} {...baseOptions}>
37-
{children}
37+
<Sentry.ErrorBoundary
38+
fallback={
39+
<div>
40+
We encountered an error trying to show this page. Please report
41+
this to us on GitHub at{" "}
42+
<a href="https://github.com/TypeCellOS/BlockNote/issues">
43+
https://github.com/TypeCellOS/BlockNote/issues
44+
</a>
45+
</div>
46+
}
47+
beforeCapture={(scope) => {
48+
scope.setTag("type", "react-render");
49+
scope.setTag("page", "examples");
50+
}}
51+
>
52+
{children}
53+
</Sentry.ErrorBoundary>
3854
</CustomDocsLayout>
3955
<Footer />
40-
<Analytics />
4156
</>
4257
);
4358
}

docs/app/global-error.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@ import * as Sentry from "@sentry/nextjs";
44
import NextError from "next/error";
55
import { useEffect } from "react";
66

7-
export default function GlobalError({ error }: { error: Error & { digest?: string } }) {
7+
export default function GlobalError({
8+
error,
9+
}: {
10+
error: Error & { digest?: string };
11+
}) {
812
useEffect(() => {
9-
Sentry.captureException(error);
13+
Sentry.captureException(error, { tags: { type: "react-render" } });
1014
}, [error]);
1115

1216
return (
@@ -20,4 +24,4 @@ export default function GlobalError({ error }: { error: Error & { digest?: strin
2024
</body>
2125
</html>
2226
);
23-
}
27+
}

docs/app/layout.config.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { AuthNavButton } from "@/components/AuthNavButton";
22
import ThemedImage from "@/components/ThemedImage";
3-
import LogoLight from "@/public/img/logos/banner.svg";
43
import LogoDark from "@/public/img/logos/banner.dark.svg";
4+
import LogoLight from "@/public/img/logos/banner.svg";
55
import {
66
NavbarSidebarTrigger,
77
type DocsLayoutProps,
88
} from "fumadocs-ui/layouts/docs";
9-
import { FaBook, FaCode, FaDiscord, FaGithub } from "react-icons/fa";
109
import { HomeLayoutProps } from "fumadocs-ui/layouts/home";
10+
import { FaBook, FaCode, FaGithub } from "react-icons/fa";
1111

1212
/**
1313
* Shared layout configurations
@@ -67,12 +67,12 @@ export const baseOptions: Partial<DocsLayoutProps & HomeLayoutProps> = {
6767
url: "/about",
6868
active: "url",
6969
},
70-
{
71-
type: "icon",
72-
icon: <FaDiscord />,
73-
text: "Discord",
74-
url: "https://discord.gg/Qc2QTTH5dF",
75-
},
70+
// {
71+
// type: "icon",
72+
// icon: <FaDiscord />,
73+
// text: "Discord",
74+
// url: "https://discord.gg/Qc2QTTH5dF",
75+
// },
7676
{
7777
type: "icon",
7878
icon: <FaGithub />,

docs/app/layout.tsx

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
import { Analytics } from "@vercel/analytics/react";
12
import { Banner } from "fumadocs-ui/components/banner";
23
import { RootProvider } from "fumadocs-ui/provider";
3-
import { Analytics } from "@vercel/analytics/react";
44
import { Metadata } from "next";
55
import type { ReactNode } from "react";
6+
import * as Sentry from "@sentry/nextjs";
67

78
import { getFullMetadata } from "@/util/getFullMetadata";
89

@@ -29,7 +30,22 @@ export default function Layout({ children }: { children: ReactNode }) {
2930
Access the early preview.
3031
</a>
3132
</Banner>
32-
<RootProvider>{children as any}</RootProvider>
33+
<Sentry.ErrorBoundary
34+
fallback={
35+
<div>
36+
We encountered an error trying to show this page. Please report
37+
this to us on GitHub at{" "}
38+
<a href="https://github.com/TypeCellOS/BlockNote/issues">
39+
https://github.com/TypeCellOS/BlockNote/issues
40+
</a>
41+
</div>
42+
}
43+
beforeCapture={(scope) => {
44+
scope.setTag("type", "react-render");
45+
}}
46+
>
47+
<RootProvider>{children}</RootProvider>
48+
</Sentry.ErrorBoundary>
3349
<Analytics />
3450
</body>
3551
</html>

docs/app/legal/blocknote-xl-commercial-license/layout.tsx

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,30 @@ import { HomeLayout } from "fumadocs-ui/layouts/home";
22
import type { ReactNode } from "react";
33
import { baseOptions } from "@/app/layout.config";
44
import { Footer } from "@/components/Footer";
5+
import * as Sentry from "@sentry/nextjs";
56

67
export default function Layout({ children }: { children: ReactNode }) {
78
return (
89
<>
9-
<HomeLayout {...baseOptions}>{children}</HomeLayout>
10+
<HomeLayout {...baseOptions}>
11+
<Sentry.ErrorBoundary
12+
fallback={
13+
<div>
14+
We encountered an error trying to show this page. Please report
15+
this to us on GitHub at{" "}
16+
<a href="https://github.com/TypeCellOS/BlockNote/issues">
17+
https://github.com/TypeCellOS/BlockNote/issues
18+
</a>
19+
</div>
20+
}
21+
beforeCapture={(scope) => {
22+
scope.setTag("type", "react-render");
23+
scope.setTag("page", "legal/blocknote-xl-commercial-license");
24+
}}
25+
>
26+
{children}
27+
</Sentry.ErrorBoundary>
28+
</HomeLayout>
1029
<Footer />
1130
</>
1231
);

docs/app/legal/privacy-policy/layout.tsx

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,30 @@ import { HomeLayout } from "fumadocs-ui/layouts/home";
22
import type { ReactNode } from "react";
33
import { baseOptions } from "@/app/layout.config";
44
import { Footer } from "@/components/Footer";
5+
import * as Sentry from "@sentry/nextjs";
56

67
export default function Layout({ children }: { children: ReactNode }) {
78
return (
89
<>
9-
<HomeLayout {...baseOptions}>{children}</HomeLayout>
10+
<HomeLayout {...baseOptions}>
11+
<Sentry.ErrorBoundary
12+
fallback={
13+
<div>
14+
We encountered an error trying to show this page. Please report
15+
this to us on GitHub at{" "}
16+
<a href="https://github.com/TypeCellOS/BlockNote/issues">
17+
https://github.com/TypeCellOS/BlockNote/issues
18+
</a>
19+
</div>
20+
}
21+
beforeCapture={(scope) => {
22+
scope.setTag("type", "react-render");
23+
scope.setTag("page", "legal/privacy-policy");
24+
}}
25+
>
26+
{children}
27+
</Sentry.ErrorBoundary>
28+
</HomeLayout>
1029
<Footer />
1130
</>
1231
);

docs/app/legal/service-level-agreement/layout.tsx

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,30 @@ import { HomeLayout } from "fumadocs-ui/layouts/home";
22
import type { ReactNode } from "react";
33
import { baseOptions } from "@/app/layout.config";
44
import { Footer } from "@/components/Footer";
5+
import * as Sentry from "@sentry/nextjs";
56

67
export default function Layout({ children }: { children: ReactNode }) {
78
return (
89
<>
9-
<HomeLayout {...baseOptions}>{children}</HomeLayout>
10+
<HomeLayout {...baseOptions}>
11+
<Sentry.ErrorBoundary
12+
fallback={
13+
<div>
14+
We encountered an error trying to show this page. Please report
15+
this to us on GitHub at{" "}
16+
<a href="https://github.com/TypeCellOS/BlockNote/issues">
17+
https://github.com/TypeCellOS/BlockNote/issues
18+
</a>
19+
</div>
20+
}
21+
beforeCapture={(scope) => {
22+
scope.setTag("type", "react-render");
23+
scope.setTag("page", "legal/service-level-agreement");
24+
}}
25+
>
26+
{children}
27+
</Sentry.ErrorBoundary>
28+
</HomeLayout>
1029
<Footer />
1130
</>
1231
);

0 commit comments

Comments
 (0)