From 1eef6a3a3f33333711b48a315db4bb98fa8f0eba Mon Sep 17 00:00:00 2001 From: Maharshi Alpesh Date: Wed, 18 Dec 2024 21:22:14 +0530 Subject: [PATCH] chore: changing the position of callout --- apps/docs/app/docs/[[...slug]]/page.tsx | 2 + .../components/docs/nextui-pro-callout.tsx | 46 +++++++++++++++++++ apps/docs/components/docs/toc.tsx | 43 +---------------- apps/docs/components/primitives.ts | 1 - 4 files changed, 49 insertions(+), 43 deletions(-) create mode 100644 apps/docs/components/docs/nextui-pro-callout.tsx diff --git a/apps/docs/app/docs/[[...slug]]/page.tsx b/apps/docs/app/docs/[[...slug]]/page.tsx index 0c37cbbb74..038547ce50 100644 --- a/apps/docs/app/docs/[[...slug]]/page.tsx +++ b/apps/docs/app/docs/[[...slug]]/page.tsx @@ -11,6 +11,7 @@ import {Route} from "@/libs/docs/page"; import {GITHUB_URL, REPO_NAME} from "@/libs/github/constants"; import {CONTENT_PATH, TAG} from "@/libs/docs/config"; import {getHeadings} from "@/libs/docs/utils"; +import {NextUIProCallout} from "@/components/docs/nextui-pro-callout"; interface DocPageProps { params: { @@ -102,6 +103,7 @@ export default async function DocPage({params}: DocPageProps) { {headings && headings.length > 0 && (
+
)} diff --git a/apps/docs/components/docs/nextui-pro-callout.tsx b/apps/docs/components/docs/nextui-pro-callout.tsx new file mode 100644 index 0000000000..1fdc8174b4 --- /dev/null +++ b/apps/docs/components/docs/nextui-pro-callout.tsx @@ -0,0 +1,46 @@ +"use client"; + +import {usePostHog} from "posthog-js/react"; +import NextLink from "next/link"; + +export const NextUIProCallout = () => { + const posthog = usePostHog(); + + const handleClick = () => { + posthog.capture("NextUI Pro Banner", { + action: "click", + category: "nextui-callout", + }); + }; + + return ( +
+
+

+ Ship  + + faster + +
+ with beautiful +
+ components +

+

+ Discover 210+ stunning, responsive components crafted by the NextUI team. +

+
+
+ +
+ Explore Components +
+
+ +
+ ); +}; diff --git a/apps/docs/components/docs/toc.tsx b/apps/docs/components/docs/toc.tsx index bba1307b39..72e964a620 100644 --- a/apps/docs/components/docs/toc.tsx +++ b/apps/docs/components/docs/toc.tsx @@ -5,9 +5,6 @@ import {clsx} from "@nextui-org/shared-utils"; import {Divider, Spacer} from "@nextui-org/react"; import {ChevronCircleTopLinearIcon} from "@nextui-org/shared-icons"; import scrollIntoView from "scroll-into-view-if-needed"; -import {usePostHog} from "posthog-js/react"; - -import {title} from "../primitives"; import {Heading} from "@/libs/docs/utils"; import {useScrollSpy} from "@/hooks/use-scroll-spy"; @@ -67,20 +64,11 @@ export const DocsToc: FC = ({headings}) => { }; }, []); - const posthog = usePostHog(); - - const handleClick = () => { - posthog.capture("NextUI Pro Banner", { - action: "click", - category: "nextui-callout", - }); - }; - return (
= ({headings}) => { -
- -
-

Ship 

-

faster 

-
-
-

with 

-

beautiful 

-
-
-

components

-
-

- Discover 210+ stunning, responsive components crafted by the NextUI team. -

-
- -
- Explore Components -
-
-
-
); }; diff --git a/apps/docs/components/primitives.ts b/apps/docs/components/primitives.ts index db6fc3303d..1cd71dbccc 100644 --- a/apps/docs/components/primitives.ts +++ b/apps/docs/components/primitives.ts @@ -17,7 +17,6 @@ export const title = tv({ foreground: "dark:from-[#FFFFFF] dark:to-[#4B4B4B]", }, size: { - xs: "text-lg lg:text-xl", sm: "text-3xl lg:text-4xl", md: "text-[clamp(1rem,10vw,2rem)] sm:text-[clamp(1rem,10vw,3rem)] lg:text-5xl", lg: "text-4xl lg:text-6xl",