Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion docs/app/(home)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,30 @@ import type { ReactNode } from "react";
import { HomeLayout } from "fumadocs-ui/layouts/home";
import { baseOptions } from "@/app/layout.config";
import { Footer } from "@/components/Footer";
import * as Sentry from "@sentry/nextjs";

export default function Layout({ children }: { children: ReactNode }) {
return (
<>
<HomeLayout {...baseOptions}>{children}</HomeLayout>
<HomeLayout {...baseOptions}>
<Sentry.ErrorBoundary
fallback={
<div>
We encountered an error trying to show this page. Please report
this to us on GitHub at{" "}
<a href="https://github.com/TypeCellOS/BlockNote/issues">
https://github.com/TypeCellOS/BlockNote/issues
</a>
</div>
}
beforeCapture={(scope) => {
scope.setTag("type", "react-render");
scope.setTag("page", "home");
}}
>
{children}
</Sentry.ErrorBoundary>
</HomeLayout>
<Footer />
</>
);
Expand Down
21 changes: 20 additions & 1 deletion docs/app/about/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,30 @@ import { HomeLayout } from "fumadocs-ui/layouts/home";
import type { ReactNode } from "react";
import { baseOptions } from "@/app/layout.config";
import { Footer } from "@/components/Footer";
import * as Sentry from "@sentry/nextjs";

export default function Layout({ children }: { children: ReactNode }) {
return (
<>
<HomeLayout {...baseOptions}>{children}</HomeLayout>
<HomeLayout {...baseOptions}>
<Sentry.ErrorBoundary
fallback={
<div>
We encountered an error trying to show this page. Please report
this to us on GitHub at{" "}
<a href="https://github.com/TypeCellOS/BlockNote/issues">
https://github.com/TypeCellOS/BlockNote/issues
</a>
</div>
}
beforeCapture={(scope) => {
scope.setTag("type", "react-render");
scope.setTag("page", "about");
}}
>
{children}
</Sentry.ErrorBoundary>
</HomeLayout>
<Footer />
</>
);
Expand Down
23 changes: 19 additions & 4 deletions docs/app/docs/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,33 @@
import type { ReactNode } from "react";
import { Analytics } from "@vercel/analytics/react";
import { baseOptions } from "@/app/layout.config";
import { CustomDocsLayout } from "@/components/CustomDocsLayout";
import { Footer } from "@/components/Footer";
import { source } from "@/lib/source/docs";
import type { ReactNode } from "react";
import * as Sentry from "@sentry/nextjs";

export default function Layout({ children }: { children: ReactNode }) {
return (
<>
<CustomDocsLayout tree={source.pageTree} {...baseOptions}>
{children}
<Sentry.ErrorBoundary
fallback={
<div>
We encountered an error trying to show this page. Please report
this to us on GitHub at{" "}
<a href="https://github.com/TypeCellOS/BlockNote/issues">
https://github.com/TypeCellOS/BlockNote/issues
</a>
</div>
}
beforeCapture={(scope) => {
scope.setTag("type", "react-render");
scope.setTag("page", "docs");
}}
>
{children}
</Sentry.ErrorBoundary>
</CustomDocsLayout>
<Footer />
<Analytics />
</>
);
}
25 changes: 20 additions & 5 deletions docs/app/examples/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { ReactNode } from "react";
import { Analytics } from "@vercel/analytics/react";
import { baseOptions } from "@/app/layout.config";
import { CustomDocsLayout } from "@/components/CustomDocsLayout";
import { Footer } from "@/components/Footer";
import { ProBadge } from "@/components/ProBadge";
import { source } from "@/lib/source/examples";
import { getExampleData } from "@/util/getExampleData";
import type { ReactNode } from "react";
import * as Sentry from "@sentry/nextjs";

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

page.name = (
<span>
{exampleData.title}
<span className="mr-1">{exampleData.title}</span>
{exampleData.isPro && <ProBadge />}
</span>
);
Expand All @@ -34,10 +34,25 @@ export default function Layout({ children }: { children: ReactNode }) {
return (
<>
<CustomDocsLayout tree={source.pageTree} {...baseOptions}>
{children}
<Sentry.ErrorBoundary
fallback={
<div>
We encountered an error trying to show this page. Please report
this to us on GitHub at{" "}
<a href="https://github.com/TypeCellOS/BlockNote/issues">
https://github.com/TypeCellOS/BlockNote/issues
</a>
</div>
}
beforeCapture={(scope) => {
scope.setTag("type", "react-render");
scope.setTag("page", "examples");
}}
>
{children}
</Sentry.ErrorBoundary>
</CustomDocsLayout>
<Footer />
<Analytics />
</>
);
}
10 changes: 7 additions & 3 deletions docs/app/global-error.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ import * as Sentry from "@sentry/nextjs";
import NextError from "next/error";
import { useEffect } from "react";

export default function GlobalError({ error }: { error: Error & { digest?: string } }) {
export default function GlobalError({
error,
}: {
error: Error & { digest?: string };
}) {
useEffect(() => {
Sentry.captureException(error);
Sentry.captureException(error, { tags: { type: "react-render" } });
}, [error]);

return (
Expand All @@ -20,4 +24,4 @@ export default function GlobalError({ error }: { error: Error & { digest?: strin
</body>
</html>
);
}
}
16 changes: 8 additions & 8 deletions docs/app/layout.config.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { AuthNavButton } from "@/components/AuthNavButton";
import ThemedImage from "@/components/ThemedImage";
import LogoLight from "@/public/img/logos/banner.svg";
import LogoDark from "@/public/img/logos/banner.dark.svg";
import LogoLight from "@/public/img/logos/banner.svg";
import {
NavbarSidebarTrigger,
type DocsLayoutProps,
} from "fumadocs-ui/layouts/docs";
import { FaBook, FaCode, FaDiscord, FaGithub } from "react-icons/fa";
import { HomeLayoutProps } from "fumadocs-ui/layouts/home";
import { FaBook, FaCode, FaGithub } from "react-icons/fa";

/**
* Shared layout configurations
Expand Down Expand Up @@ -67,12 +67,12 @@ export const baseOptions: Partial<DocsLayoutProps & HomeLayoutProps> = {
url: "/about",
active: "url",
},
{
type: "icon",
icon: <FaDiscord />,
text: "Discord",
url: "https://discord.gg/Qc2QTTH5dF",
},
// {
// type: "icon",
// icon: <FaDiscord />,
// text: "Discord",
// url: "https://discord.gg/Qc2QTTH5dF",
// },
{
type: "icon",
icon: <FaGithub />,
Expand Down
20 changes: 18 additions & 2 deletions docs/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { Analytics } from "@vercel/analytics/react";
import { Banner } from "fumadocs-ui/components/banner";
import { RootProvider } from "fumadocs-ui/provider";
import { Analytics } from "@vercel/analytics/react";
import { Metadata } from "next";
import type { ReactNode } from "react";
import * as Sentry from "@sentry/nextjs";

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

Expand All @@ -29,7 +30,22 @@ export default function Layout({ children }: { children: ReactNode }) {
Access the early preview.
</a>
</Banner>
<RootProvider>{children as any}</RootProvider>
<Sentry.ErrorBoundary
fallback={
<div>
We encountered an error trying to show this page. Please report
this to us on GitHub at{" "}
<a href="https://github.com/TypeCellOS/BlockNote/issues">
https://github.com/TypeCellOS/BlockNote/issues
</a>
</div>
}
beforeCapture={(scope) => {
scope.setTag("type", "react-render");
}}
>
<RootProvider>{children}</RootProvider>
</Sentry.ErrorBoundary>
<Analytics />
</body>
</html>
Expand Down
21 changes: 20 additions & 1 deletion docs/app/legal/blocknote-xl-commercial-license/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,30 @@ import { HomeLayout } from "fumadocs-ui/layouts/home";
import type { ReactNode } from "react";
import { baseOptions } from "@/app/layout.config";
import { Footer } from "@/components/Footer";
import * as Sentry from "@sentry/nextjs";

export default function Layout({ children }: { children: ReactNode }) {
return (
<>
<HomeLayout {...baseOptions}>{children}</HomeLayout>
<HomeLayout {...baseOptions}>
<Sentry.ErrorBoundary
fallback={
<div>
We encountered an error trying to show this page. Please report
this to us on GitHub at{" "}
<a href="https://github.com/TypeCellOS/BlockNote/issues">
https://github.com/TypeCellOS/BlockNote/issues
</a>
</div>
}
beforeCapture={(scope) => {
scope.setTag("type", "react-render");
scope.setTag("page", "legal/blocknote-xl-commercial-license");
}}
>
{children}
</Sentry.ErrorBoundary>
</HomeLayout>
<Footer />
</>
);
Expand Down
21 changes: 20 additions & 1 deletion docs/app/legal/privacy-policy/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,30 @@ import { HomeLayout } from "fumadocs-ui/layouts/home";
import type { ReactNode } from "react";
import { baseOptions } from "@/app/layout.config";
import { Footer } from "@/components/Footer";
import * as Sentry from "@sentry/nextjs";

export default function Layout({ children }: { children: ReactNode }) {
return (
<>
<HomeLayout {...baseOptions}>{children}</HomeLayout>
<HomeLayout {...baseOptions}>
<Sentry.ErrorBoundary
fallback={
<div>
We encountered an error trying to show this page. Please report
this to us on GitHub at{" "}
<a href="https://github.com/TypeCellOS/BlockNote/issues">
https://github.com/TypeCellOS/BlockNote/issues
</a>
</div>
}
beforeCapture={(scope) => {
scope.setTag("type", "react-render");
scope.setTag("page", "legal/privacy-policy");
}}
>
{children}
</Sentry.ErrorBoundary>
</HomeLayout>
<Footer />
</>
);
Expand Down
21 changes: 20 additions & 1 deletion docs/app/legal/service-level-agreement/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,30 @@ import { HomeLayout } from "fumadocs-ui/layouts/home";
import type { ReactNode } from "react";
import { baseOptions } from "@/app/layout.config";
import { Footer } from "@/components/Footer";
import * as Sentry from "@sentry/nextjs";

export default function Layout({ children }: { children: ReactNode }) {
return (
<>
<HomeLayout {...baseOptions}>{children}</HomeLayout>
<HomeLayout {...baseOptions}>
<Sentry.ErrorBoundary
fallback={
<div>
We encountered an error trying to show this page. Please report
this to us on GitHub at{" "}
<a href="https://github.com/TypeCellOS/BlockNote/issues">
https://github.com/TypeCellOS/BlockNote/issues
</a>
</div>
}
beforeCapture={(scope) => {
scope.setTag("type", "react-render");
scope.setTag("page", "legal/service-level-agreement");
}}
>
{children}
</Sentry.ErrorBoundary>
</HomeLayout>
<Footer />
</>
);
Expand Down
21 changes: 20 additions & 1 deletion docs/app/legal/terms-and-conditions/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,30 @@ import { HomeLayout } from "fumadocs-ui/layouts/home";
import type { ReactNode } from "react";
import { baseOptions } from "@/app/layout.config";
import { Footer } from "@/components/Footer";
import * as Sentry from "@sentry/nextjs";

export default function Layout({ children }: { children: ReactNode }) {
return (
<>
<HomeLayout {...baseOptions}>{children}</HomeLayout>
<HomeLayout {...baseOptions}>
<Sentry.ErrorBoundary
fallback={
<div>
We encountered an error trying to show this page. Please report
this to us on GitHub at{" "}
<a href="https://github.com/TypeCellOS/BlockNote/issues">
https://github.com/TypeCellOS/BlockNote/issues
</a>
</div>
}
beforeCapture={(scope) => {
scope.setTag("type", "react-render");
scope.setTag("page", "legal/terms-and-conditions");
}}
>
{children}
</Sentry.ErrorBoundary>
</HomeLayout>
<Footer />
</>
);
Expand Down
Loading
Loading