Skip to content

Commit a0b23a9

Browse files
committed
chore: changing the position of callout
1 parent 52018cd commit a0b23a9

File tree

4 files changed

+50
-43
lines changed

4 files changed

+50
-43
lines changed

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

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {Route} from "@/libs/docs/page";
1111
import {GITHUB_URL, REPO_NAME} from "@/libs/github/constants";
1212
import {CONTENT_PATH, TAG} from "@/libs/docs/config";
1313
import {getHeadings} from "@/libs/docs/utils";
14+
import {NextUIProCallout} from "@/components/docs/nextui-pro-callout";
1415

1516
interface DocPageProps {
1617
params: {
@@ -102,6 +103,7 @@ export default async function DocPage({params}: DocPageProps) {
102103
{headings && headings.length > 0 && (
103104
<div className="hidden z-10 xl:flex xl:col-span-2 mt-8 pl-0">
104105
<DocsToc headings={headings} />
106+
<NextUIProCallout />
105107
</div>
106108
)}
107109
</>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
"use client";
2+
3+
import {usePostHog} from "posthog-js/react";
4+
5+
export const NextUIProCallout = () => {
6+
const posthog = usePostHog();
7+
8+
const handleClick = () => {
9+
posthog.capture("NextUI Pro Banner", {
10+
action: "click",
11+
category: "nextui-callout",
12+
});
13+
};
14+
15+
return (
16+
<div className="fixed top-[calc(100vh-320px)] border border-default/60 hover:shadow-inner hover:border-default/80 rounded-md py-6 px-2 m-2 cursor-pointer">
17+
<a
18+
className="flex flex-col items-center"
19+
href="https://nextui.pro/components?utm_source=nextui.org&utm_medium=callout"
20+
rel="noopener noreferrer"
21+
onClick={handleClick}
22+
>
23+
<div>
24+
<p className="leading-none tracking-tight text-center text-xl font-semibold">
25+
Ship&nbsp;
26+
<span className="bg-clip-text text-transparent bg-gradient-to-b from-[#5EA2EF] to-[#0072F5]">
27+
faster&nbsp;
28+
</span>
29+
<br />
30+
with&nbsp; beautiful&nbsp;
31+
<br />
32+
components
33+
</p>
34+
<p className="text-center text-xs mt-2.5 px-6 font-medium text-default-500 leading-tight">
35+
Discover 210+ stunning, responsive components crafted by the NextUI team.
36+
</p>
37+
</div>
38+
<div className="mt-2 flex group min-w-[120px] items-center font-semibold text-foreground shadow-sm gap-1.5 relative overflow-hidden rounded-full p-[1px]">
39+
<span className="absolute inset-[-1000%] bg-[conic-gradient(from_90deg_at_50%_50%,#F54180_0%,#338EF7_50%,#F54180_100%)]" />
40+
<div className="inline-flex h-full w-full cursor-pointer items-center justify-center rounded-full bg-background transition-background px-4 py-2 text-xs font-medium text-foreground backdrop-blur-3xl">
41+
Explore Components
42+
</div>
43+
</div>
44+
</a>
45+
</div>
46+
);
47+
};

apps/docs/components/docs/toc.tsx

+1-42
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ import {clsx} from "@nextui-org/shared-utils";
55
import {Divider, Spacer} from "@nextui-org/react";
66
import {ChevronCircleTopLinearIcon} from "@nextui-org/shared-icons";
77
import scrollIntoView from "scroll-into-view-if-needed";
8-
import {usePostHog} from "posthog-js/react";
9-
10-
import {title} from "../primitives";
118

129
import {Heading} from "@/libs/docs/utils";
1310
import {useScrollSpy} from "@/hooks/use-scroll-spy";
@@ -67,20 +64,11 @@ export const DocsToc: FC<DocsTocProps> = ({headings}) => {
6764
};
6865
}, []);
6966

70-
const posthog = usePostHog();
71-
72-
const handleClick = () => {
73-
posthog.capture("NextUI Pro Banner", {
74-
action: "click",
75-
category: "nextui-callout",
76-
});
77-
};
78-
7967
return (
8068
<div
8169
ref={tocRef}
8270
className={clsx(
83-
"fixed w-full max-w-[12rem] flex flex-col gap-4 text-left pb-28 h-[calc(100vh-121px)] scrollbar-hide overflow-y-scroll",
71+
"fixed w-full max-w-[12rem] flex flex-col gap-4 text-left pb-28 h-[calc(100vh-440px)] scrollbar-hide overflow-y-scroll",
8472
isProBannerVisible ? "top-32" : "top-20",
8573
)}
8674
style={{
@@ -135,35 +123,6 @@ export const DocsToc: FC<DocsTocProps> = ({headings}) => {
135123
</a>
136124
</li>
137125
</ul>
138-
<div className="w-full border border-default/60 hover:shadow-inner hover:border-default/80 rounded-md p-2 cursor-pointer">
139-
<a
140-
className="flex flex-col items-center"
141-
href="https://nextui.pro?utm_source=nextui.org&utm_medium=callout"
142-
rel="noopener noreferrer"
143-
onClick={handleClick}
144-
>
145-
<div className="flex flex-col sm:flex-row">
146-
<h1 className={title({size: "xs"})}>Ship&nbsp;</h1>
147-
<h1 className={title({size: "xs", color: "blue"})}>faster&nbsp;</h1>
148-
</div>
149-
<div className="flex flex-col sm:flex-row">
150-
<h1 className={title({size: "xs"})}>with&nbsp;</h1>
151-
<h1 className={title({size: "xs"})}>beautiful&nbsp;</h1>
152-
</div>
153-
<div className="flex flex-col sm:flex-row">
154-
<h1 className={title({size: "xs"})}>components</h1>
155-
</div>
156-
<p className="text-center text-xs m-2 font-medium text-default-500">
157-
Discover 210+ stunning, responsive components crafted by the NextUI team.
158-
</p>
159-
<div className="flex group min-w-[120px] items-center font-semibold text-foreground shadow-sm gap-1.5 relative overflow-hidden rounded-full p-[1px]">
160-
<span className="absolute inset-[-1000%] animate-[spin_3s_linear_infinite] bg-[conic-gradient(from_90deg_at_50%_50%,#F54180_0%,#338EF7_50%,#F54180_100%)]" />
161-
<div className="inline-flex h-full w-full cursor-pointer items-center justify-center rounded-full bg-background group-hover:bg-background/70 transition-background px-3 py-1 text-sm font-medium text-foreground backdrop-blur-3xl">
162-
Explore Components
163-
</div>
164-
</div>
165-
</a>
166-
</div>
167126
</div>
168127
);
169128
};

apps/docs/components/primitives.ts

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ export const title = tv({
1717
foreground: "dark:from-[#FFFFFF] dark:to-[#4B4B4B]",
1818
},
1919
size: {
20-
xs: "text-lg lg:text-xl",
2120
sm: "text-3xl lg:text-4xl",
2221
md: "text-[clamp(1rem,10vw,2rem)] sm:text-[clamp(1rem,10vw,3rem)] lg:text-5xl",
2322
lg: "text-4xl lg:text-6xl",

0 commit comments

Comments
 (0)