Skip to content

Commit 6882f8e

Browse files
Merge pull request #71 from nocodb/update-fuma
2 parents 8d4c322 + e927e5d commit 6882f8e

File tree

16 files changed

+438
-995
lines changed

16 files changed

+438
-995
lines changed

app/docs/changelog/[...slug]/page.tsx

Lines changed: 34 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
import {changelogSource} from '@/lib/source';
2-
import {DocsBody, DocsDescription, DocsTitle,} from 'fumadocs-ui/page';
3-
import {notFound} from 'next/navigation';
4-
import {getMDXComponents} from '@/mdx-components';
1+
import { changelogSource } from '@/lib/source';
2+
import { DocsBody, DocsDescription, DocsTitle, } from 'fumadocs-ui/page';
3+
import { notFound } from 'next/navigation';
4+
import { getMDXComponents } from '@/mdx-components';
55
import { AnchorProvider } from 'fumadocs-core/toc';
6-
import { Toc, TOCScrollArea} from 'fumadocs-ui/components/layout/toc';
6+
import { PageTOC } from 'fumadocs-ui/layouts/docs/page'
7+
8+
import { TOCScrollArea } from 'fumadocs-ui/components/layout/toc';
79
import ClerkTOCItems from 'fumadocs-ui/components/layout/toc-clerk';
810
import { getPageTreePeers } from 'fumadocs-core/server';
911
import { Cards, Card } from 'fumadocs-ui/components/card';
1012
import TOCMobile from '@/components/layout/TOCMobile';
13+
import { TOCProvider } from 'fumadocs-ui/components/layout/toc';
1114

1215
export default async function Page(props: {
1316
params: Promise<{ slug?: string[] }>;
@@ -19,33 +22,34 @@ export default async function Page(props: {
1922
const MDXContent = page.data.body;
2023

2124
return (
22-
<AnchorProvider toc={page.data.toc}>
23-
<Toc className='hidden xl:sticky xl:block top-[120px] w-68 max-h-[calc(100vh-120px)] order-last shrink-0 overflow-auto'>
24-
<TOCScrollArea className='w-64'>
25-
<ClerkTOCItems items={page.data.toc} />
26-
</TOCScrollArea>
27-
</Toc>
28-
<TOCMobile toc={page.data.toc}/>
29-
<div className='flex flex-col flex-1 gap-4 mx-auto container overflow-y-auto shrink-1 max-w-179 relative p-4'>
30-
<DocsTitle>{page.data.title}</DocsTitle>
31-
<DocsDescription className="mb-0">{page.data.description}</DocsDescription>
32-
<DocsBody>
33-
<MDXContent
34-
components={getMDXComponents()}
25+
<TOCProvider toc={page.data.toc}>
26+
<AnchorProvider toc={page.data.toc}>
27+
<PageTOC className='hidden xl:sticky xl:block !top-[120px] w-68 max-h-[calc(100vh-120px)] order-last shrink-0 overflow-auto'>
28+
<TOCScrollArea className='w-64'>
29+
<ClerkTOCItems />
30+
</TOCScrollArea>
31+
</PageTOC>
32+
<TOCMobile />
33+
<div className='flex flex-col flex-1 gap-4 mx-auto container overflow-y-auto shrink-1 max-w-179 relative p-4'>
34+
<DocsTitle>{page.data.title}</DocsTitle>
35+
<DocsDescription className="mb-0">{page.data.description}</DocsDescription>
36+
<DocsBody>
37+
<MDXContent
38+
components={getMDXComponents()}
3539
/>
36-
</DocsBody>
37-
<Cards>
38-
{getPageTreePeers(changelogSource.pageTree, page.url).slice(0, 2).map((peer) => (
39-
<Card key={peer.url} title={peer.name} href={peer.url}>
40-
{peer.description}
41-
</Card>
42-
))}
43-
</Cards>
44-
<div className="py-8">
40+
</DocsBody>
41+
<Cards>
42+
{getPageTreePeers(changelogSource.pageTree, page.url).slice(0, 2).map((peer) => (
43+
<Card key={peer.url} title={peer.name} href={peer.url}>
44+
{peer.description}
45+
</Card>
46+
))}
47+
</Cards>
48+
<div className="py-8">
49+
</div>
4550
</div>
46-
</div>
47-
</AnchorProvider>
48-
51+
</AnchorProvider>
52+
</TOCProvider>
4953
);
5054
}
5155

app/docs/changelog/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Sidebar from "@/components/layout/Sidebar";
22
import { changelogSource } from "@/lib/source";
3-
import { TreeContextProvider } from "fumadocs-ui/provider";
3+
import { TreeContextProvider } from '@/provider/TreeContextProvider';
44
import { ReactNode } from "react";
55
import MobileSidebar from "@/app/docs/MobileSidebar";
66

app/docs/product-docs/[[...slug]]/page.tsx

Lines changed: 34 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
import {source} from '@/lib/source';
2-
import {DocsBody, DocsDescription, DocsTitle,} from 'fumadocs-ui/page';
3-
import {notFound} from 'next/navigation';
4-
import {getMDXComponents} from '@/mdx-components';
1+
import { source } from '@/lib/source';
2+
import { DocsBody, DocsDescription, DocsTitle, } from 'fumadocs-ui/page';
3+
import { notFound } from 'next/navigation';
4+
import { getMDXComponents } from '@/mdx-components';
55
import MdxLink from "@/components/mdx/MdxLink";
66
import { AnchorProvider } from 'fumadocs-core/toc';
7-
import { Toc, TOCScrollArea} from 'fumadocs-ui/components/layout/toc';
7+
import { TOCProvider, TOCScrollArea } from 'fumadocs-ui/components/layout/toc';
8+
import { PageTOC } from 'fumadocs-ui/layouts/docs/page'
89
import ClerkTOCItems from 'fumadocs-ui/components/layout/toc-clerk';
910
import { getPageTreePeers } from 'fumadocs-core/server';
1011
import { Cards, Card } from 'fumadocs-ui/components/card';
@@ -20,35 +21,36 @@ export default async function Page(props: {
2021
const MDXContent = page.data.body;
2122

2223
return (
23-
<AnchorProvider toc={page.data.toc}>
24-
<Toc className='hidden xl:sticky xl:block top-[120px] w-68 max-h-[calc(100vh-120px)] order-last shrink-0 overflow-auto'>
25-
<TOCScrollArea className='w-64'>
26-
<ClerkTOCItems items={page.data.toc} />
27-
</TOCScrollArea>
28-
</Toc>
29-
<TOCMobile toc={page.data.toc}/>
30-
<div className='flex flex-col flex-1 gap-4 mx-auto container overflow-y-auto shrink-1 max-w-179 relative p-4'>
31-
<DocsTitle>{page.data.title}</DocsTitle>
32-
<DocsDescription className="mb-0">{page.data.description}</DocsDescription>
33-
<DocsBody>
34-
<MDXContent
35-
components={getMDXComponents({
36-
a: MdxLink
37-
})}
24+
<TOCProvider toc={page.data.toc}>
25+
<AnchorProvider toc={page.data.toc}>
26+
<PageTOC className='hidden xl:sticky xl:block !top-[120px] w-68 max-h-[calc(100vh-120px)] order-last shrink-0 overflow-auto'>
27+
<TOCScrollArea className='w-64'>
28+
<ClerkTOCItems />
29+
</TOCScrollArea>
30+
</PageTOC>
31+
<TOCMobile />
32+
<div className='flex flex-col flex-1 gap-4 mx-auto container overflow-y-auto shrink-1 max-w-179 relative p-4'>
33+
<DocsTitle>{page.data.title}</DocsTitle>
34+
<DocsDescription className="mb-0">{page.data.description}</DocsDescription>
35+
<DocsBody>
36+
<MDXContent
37+
components={getMDXComponents({
38+
a: MdxLink
39+
})}
3840
/>
39-
</DocsBody>
40-
<Cards>
41-
{getPageTreePeers(source.pageTree, page.url).slice(0, 2).map((peer) => (
42-
<Card key={peer.url} title={peer.name} href={peer.url}>
43-
{peer.description}
44-
</Card>
45-
))}
46-
</Cards>
47-
<div className="py-8">
41+
</DocsBody>
42+
<Cards>
43+
{getPageTreePeers(source.pageTree, page.url).slice(0, 2).map((peer) => (
44+
<Card key={peer.url} title={peer.name} href={peer.url}>
45+
{peer.description}
46+
</Card>
47+
))}
48+
</Cards>
49+
<div className="py-8">
50+
</div>
4851
</div>
49-
</div>
50-
</AnchorProvider>
51-
52+
</AnchorProvider>
53+
</TOCProvider>
5254
);
5355
}
5456

app/docs/product-docs/layout.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
"use client";
21
import Sidebar from '@/components/layout/Sidebar';
32
import { source } from '@/lib/source';
4-
import { TreeContextProvider } from 'fumadocs-ui/provider';
5-
import type {ReactNode} from 'react';
3+
import { TreeContextProvider } from '@/provider/TreeContextProvider';
4+
import type { ReactNode } from 'react';
65
import MobileSidebar from '@/app/docs/MobileSidebar';
76

8-
export default function Layout({children}: { children: ReactNode }) {
7+
export default function Layout({ children }: { children: ReactNode }) {
98
return (
109
<div className='relative'>
1110
<TreeContextProvider tree={source.pageTree}>
1211
<div className="max-w-screen-xl flex flex-col xl:flex-row mt-30 mx-auto">
1312
<Sidebar />
1413
{children}
1514
</div>
16-
<MobileSidebar/>
15+
<MobileSidebar />
1716
</TreeContextProvider>
17+
1818
</div>
1919
);
2020
}

app/docs/scripts/[[...slug]]/page.tsx

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
import {scriptsSource} from '@/lib/source';
2-
import {DocsBody, DocsDescription, DocsTitle,} from 'fumadocs-ui/page';
3-
import {notFound} from 'next/navigation';
4-
import {getMDXComponents} from '@/mdx-components';
1+
import { scriptsSource } from '@/lib/source';
2+
import { DocsBody, DocsDescription, DocsTitle, } from 'fumadocs-ui/page';
3+
import { notFound } from 'next/navigation';
4+
import { getMDXComponents } from '@/mdx-components';
55
import { AnchorProvider } from 'fumadocs-core/toc';
6-
import { Toc, TOCScrollArea, } from 'fumadocs-ui/components/layout/toc';
6+
import { PageTOC } from 'fumadocs-ui/layouts/docs/page'
7+
import { TOCProvider, TOCScrollArea } from 'fumadocs-ui/components/layout/toc';
78
import ClerkTOCItems from 'fumadocs-ui/components/layout/toc-clerk';
89
import TOCMobile from '@/components/layout/TOCMobile';
910
import { getPageTreePeers } from 'fumadocs-core/server';
@@ -19,32 +20,34 @@ export default async function Page(props: {
1920
const MDXContent = page.data.body;
2021

2122
return (
22-
<AnchorProvider toc={page.data.toc}>
23-
<Toc className='hidden xl:sticky xl:block top-[120px] w-68 max-h-[calc(100vh-120px)] order-last shrink-0 overflow-auto'>
24-
<TOCScrollArea className='w-64'>
25-
<ClerkTOCItems items={page.data.toc} />
26-
</TOCScrollArea>
27-
</Toc>
28-
<TOCMobile toc={page.data.toc}/>
29-
<div className='flex flex-col flex-1 gap-4 mx-auto container overflow-y-auto shrink-1 max-w-179 relative p-4'>
30-
<DocsTitle>{page.data.title}</DocsTitle>
31-
<DocsDescription className="mb-0">{page.data.description}</DocsDescription>
32-
<DocsBody>
33-
<MDXContent
34-
components={getMDXComponents()}
23+
<TOCProvider toc={page.data.toc}>
24+
<AnchorProvider toc={page.data.toc}>
25+
<PageTOC className='hidden xl:sticky xl:block !top-[120px] w-68 max-h-[calc(100vh-120px)] order-last shrink-0 overflow-auto'>
26+
<TOCScrollArea className='w-64'>
27+
<ClerkTOCItems />
28+
</TOCScrollArea>
29+
</PageTOC>
30+
<TOCMobile />
31+
<div className='flex flex-col flex-1 gap-4 mx-auto container overflow-y-auto shrink-1 max-w-179 relative p-4'>
32+
<DocsTitle>{page.data.title}</DocsTitle>
33+
<DocsDescription className="mb-0">{page.data.description}</DocsDescription>
34+
<DocsBody>
35+
<MDXContent
36+
components={getMDXComponents()}
3537
/>
36-
</DocsBody>
37-
<Cards>
38-
{getPageTreePeers(scriptsSource.pageTree, page.url).slice(0, 2).map((peer) => (
39-
<Card key={peer.url} title={peer.name} href={peer.url}>
40-
{peer.description}
41-
</Card>
42-
))}
43-
</Cards>
44-
<div className="py-8">
38+
</DocsBody>
39+
<Cards>
40+
{getPageTreePeers(scriptsSource.pageTree, page.url).slice(0, 2).map((peer) => (
41+
<Card key={peer.url} title={peer.name} href={peer.url}>
42+
{peer.description}
43+
</Card>
44+
))}
45+
</Cards>
46+
<div className="py-8">
47+
</div>
4548
</div>
46-
</div>
47-
</AnchorProvider>
49+
</AnchorProvider>
50+
</TOCProvider>
4851
);
4952
}
5053

app/docs/scripts/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Sidebar from "@/components/layout/Sidebar";
22
import { scriptsSource } from "@/lib/source";
3-
import { TreeContextProvider } from "fumadocs-ui/provider";
3+
import { TreeContextProvider } from '@/provider/TreeContextProvider';
44
import { ReactNode } from "react";
55
import MobileSidebar from "@/app/docs/MobileSidebar";
66

app/docs/self-hosting/[[...slug]]/page.tsx

Lines changed: 35 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
import {selfHostingSource} from '@/lib/source';
2-
import {DocsBody, DocsDescription, DocsTitle,} from 'fumadocs-ui/page';
3-
import {notFound} from 'next/navigation';
4-
import {getMDXComponents} from '@/mdx-components';
1+
import { selfHostingSource } from '@/lib/source';
2+
import { DocsBody, DocsDescription, DocsTitle, } from 'fumadocs-ui/page';
3+
import { notFound } from 'next/navigation';
4+
import { getMDXComponents } from '@/mdx-components';
5+
import MdxLink from "@/components/mdx/MdxLink";
56
import { AnchorProvider } from 'fumadocs-core/toc';
6-
import { Toc, TOCScrollArea} from 'fumadocs-ui/components/layout/toc';
7+
import { TOCProvider, TOCScrollArea } from 'fumadocs-ui/components/layout/toc';
8+
import { PageTOC } from 'fumadocs-ui/layouts/docs/page'
79
import ClerkTOCItems from 'fumadocs-ui/components/layout/toc-clerk';
810
import { getPageTreePeers } from 'fumadocs-core/server';
911
import { Cards, Card } from 'fumadocs-ui/components/card';
@@ -19,33 +21,36 @@ export default async function Page(props: {
1921
const MDXContent = page.data.body;
2022

2123
return (
22-
<AnchorProvider toc={page.data.toc}>
23-
<Toc className='hidden xl:sticky xl:block top-[120px] w-68 max-h-[calc(100vh-120px)] order-last shrink-0 overflow-auto'>
24-
<TOCScrollArea className='w-64'>
25-
<ClerkTOCItems items={page.data.toc} />
26-
</TOCScrollArea>
27-
</Toc>
28-
<TOCMobile toc={page.data.toc}/>
29-
<div className='flex flex-col flex-1 gap-4 mx-auto container overflow-y-auto shrink-1 max-w-179 relative p-4'>
30-
<DocsTitle>{page.data.title}</DocsTitle>
31-
<DocsDescription className="mb-0">{page.data.description}</DocsDescription>
32-
<DocsBody>
33-
<MDXContent
34-
components={getMDXComponents()}
24+
<TOCProvider toc={page.data.toc}>
25+
<AnchorProvider toc={page.data.toc}>
26+
<PageTOC className='hidden xl:sticky xl:block !top-[120px] w-68 max-h-[calc(100vh-120px)] order-last shrink-0 overflow-auto'>
27+
<TOCScrollArea className='w-64'>
28+
<ClerkTOCItems />
29+
</TOCScrollArea>
30+
</PageTOC>
31+
<TOCMobile />
32+
<div className='flex flex-col flex-1 gap-4 mx-auto container overflow-y-auto shrink-1 max-w-179 relative p-4'>
33+
<DocsTitle>{page.data.title}</DocsTitle>
34+
<DocsDescription className="mb-0">{page.data.description}</DocsDescription>
35+
<DocsBody>
36+
<MDXContent
37+
components={getMDXComponents({
38+
a: MdxLink
39+
})}
3540
/>
36-
</DocsBody>
37-
<Cards>
38-
{getPageTreePeers(selfHostingSource.pageTree, page.url).slice(0, 2).map((peer) => (
39-
<Card key={peer.url} title={peer.name} href={peer.url}>
40-
{peer.description}
41-
</Card>
42-
))}
43-
</Cards>
44-
<div className="py-8">
41+
</DocsBody>
42+
<Cards>
43+
{getPageTreePeers(selfHostingSource.pageTree, page.url).slice(0, 2).map((peer) => (
44+
<Card key={peer.url} title={peer.name} href={peer.url}>
45+
{peer.description}
46+
</Card>
47+
))}
48+
</Cards>
49+
<div className="py-8">
50+
</div>
4551
</div>
46-
</div>
47-
</AnchorProvider>
48-
52+
</AnchorProvider>
53+
</TOCProvider>
4954
);
5055
}
5156

app/docs/self-hosting/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Sidebar from "@/components/layout/Sidebar";
22
import { selfHostingSource } from "@/lib/source";
3-
import { TreeContextProvider } from "fumadocs-ui/provider";
3+
import { TreeContextProvider } from '@/provider/TreeContextProvider';
44
import { ReactNode } from "react";
55
import MobileSidebar from "@/app/docs/MobileSidebar";
66

components/layout/Navbar.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import Image from "next/image";
77
import {Button} from "@/components/ui/button";
88
import {ThemeSwitch} from "@/components/layout/ThemeSwitch";
99
import {SearchTrigger} from "@/components/layout/SearchTrigger";
10+
import {SearchTriggerIcon} from "@/components/layout/SearchTriggerIcon";
11+
1012
import Link from "next/link";
1113
import { useTheme } from "next-themes";
1214
import { Menu, X } from "lucide-react"
@@ -43,6 +45,10 @@ export default function Navbar() {
4345
</Link>
4446
</div>
4547
</div>
48+
<div className="lg:hidden flex gap-3 items-center">
49+
<SearchTriggerIcon />
50+
<ThemeSwitch />
51+
</div>
4652
</div>
4753
)
4854
}

0 commit comments

Comments
 (0)