From 2948e2b91d5617647a58981a36d22d4266a48f1f Mon Sep 17 00:00:00 2001 From: Arghya Das Date: Thu, 2 Jan 2025 23:45:36 +0530 Subject: [PATCH 1/2] feat: changed the mdx table style --- components/mdx-components.tsx | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/components/mdx-components.tsx b/components/mdx-components.tsx index b3668f9a5..59de55c53 100644 --- a/components/mdx-components.tsx +++ b/components/mdx-components.tsx @@ -1,7 +1,6 @@ import { useMDXComponent } from "@content-collections/mdx/react"; import Image from "next/image"; import Link from "next/link"; - import { Callout } from "@/components/callout"; import RepoDownload from "@/components/repo-download"; import TechStack from "@/components/tech-stack"; @@ -16,7 +15,6 @@ import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; import { Event } from "@/lib/events"; import { cn } from "@/lib/utils"; import TweetCard from "@/registry/default/magicui/tweet-card"; - import { ComponentPreview } from "./component-preview"; import { ComponentSource } from "./component-source"; import { CopyButton, CopyNpmCommandButton } from "./copy-button"; @@ -134,17 +132,38 @@ const components = { /> ), table: ({ className, ...props }: React.HTMLAttributes) => ( -
- +
+
), + thead: ({ + className, + ...props + }: React.HTMLAttributes) => ( + + ), tr: ({ className, ...props }: React.HTMLAttributes) => ( - + ), th: ({ className, ...props }: React.HTMLAttributes) => (
) => ( Date: Thu, 2 Jan 2025 17:00:23 -0500 Subject: [PATCH 2/2] fix: update style --- components/mdx-components.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/components/mdx-components.tsx b/components/mdx-components.tsx index 59de55c53..082da0aad 100644 --- a/components/mdx-components.tsx +++ b/components/mdx-components.tsx @@ -1,6 +1,3 @@ -import { useMDXComponent } from "@content-collections/mdx/react"; -import Image from "next/image"; -import Link from "next/link"; import { Callout } from "@/components/callout"; import RepoDownload from "@/components/repo-download"; import TechStack from "@/components/tech-stack"; @@ -15,6 +12,9 @@ import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; import { Event } from "@/lib/events"; import { cn } from "@/lib/utils"; import TweetCard from "@/registry/default/magicui/tweet-card"; +import { useMDXComponent } from "@content-collections/mdx/react"; +import Image from "next/image"; +import Link from "next/link"; import { ComponentPreview } from "./component-preview"; import { ComponentSource } from "./component-source"; import { CopyButton, CopyNpmCommandButton } from "./copy-button"; @@ -132,9 +132,9 @@ const components = { /> ), table: ({ className, ...props }: React.HTMLAttributes) => ( -
+
@@ -163,7 +163,7 @@ const components = { th: ({ className, ...props }: React.HTMLAttributes) => (