Skip to content

Commit 58de96f

Browse files
style: updated examples grid and CTA button (#1986)
1 parent f739c6c commit 58de96f

File tree

5 files changed

+15
-7
lines changed

5 files changed

+15
-7
lines changed

docs/app/examples/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default function Layout({ children }: { children: ReactNode }) {
2222

2323
page.name = (
2424
<span>
25-
{exampleData.title}
25+
<span className="mr-1">{exampleData.title}</span>
2626
{exampleData.isPro && <ProBadge />}
2727
</span>
2828
);

docs/components/CTAButton.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ import { ReactNode } from "react";
44
export default function CTAButton(props: {
55
href: string;
66
hoverGlow?: boolean;
7-
size?: "small" | "large";
7+
size?: "default" | "small";
8+
variant?: "default" | "colored";
89
children: ReactNode;
910
}) {
1011
return (
1112
<div className="not-prose button-glow-parent relative flex h-fit w-fit flex-wrap text-nowrap">
1213
<Link
13-
className={`bg-fd-accent border-fd-border text-fd-foreground z-20 m-0 rounded-full border font-medium ${props.size === "small" ? "px-3 py-1.5 text-xs md:text-sm" : "px-4 py-2 text-base md:text-lg"}`}
14+
className={`z-20 m-0 rounded-full font-medium ${props.variant === "colored" ? "text-fd-background dark:text-fd-foreground bg-indigo-600 hover:bg-indigo-500" : "bg-fd-accent border-fd-border text-fd-foreground border"} ${props.size === "small" ? "px-3 py-1.5 text-xs md:text-sm" : "px-4 py-2 text-base md:text-lg"}`}
1415
href={props.href}
1516
suppressHydrationWarning
1617
>

docs/components/Example.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ function ExampleProPrompt() {
119119
BlockNote Pro
120120
</p>
121121
<div className={"mt-8"}>
122-
<CTAButton href={"/pricing"} size={"large"} hoverGlow={true}>
122+
<CTAButton href={"/pricing"} variant={"colored"} hoverGlow={true}>
123123
Get BlockNote Pro
124124
</CTAButton>
125125
</div>

docs/components/ExampleCards.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { Heading } from "fumadocs-ui/components/heading";
33

44
import { exampleGroupsData } from "./example/generated/exampleGroupsData.gen";
55
import { Fragment } from "react";
6+
import { ProBadge } from "./ProBadge";
67

78
export default function ExampleCards() {
89
return (
@@ -14,10 +15,11 @@ export default function ExampleCards() {
1415
</Heading>
1516
<Cards
1617
key={exampleGroupData.exampleGroupName + "-cards"}
17-
className="mb-8"
18+
className="mb-8 grid-cols-1 sm:grid-cols-2 lg:grid-cols-3"
1819
>
1920
{exampleGroupData.examplesData.map((exampleData) => (
2021
<Card
22+
className="@max-lg:col-span-1"
2123
key={
2224
exampleGroupData.exampleGroupName +
2325
"-" +
@@ -32,7 +34,12 @@ export default function ExampleCards() {
3234
/>
3335
) : undefined
3436
}
35-
title={exampleData.title}
37+
title={
38+
<span>
39+
<span className="mr-1">{exampleData.title}</span>
40+
{exampleData.isPro && <ProBadge />}
41+
</span>
42+
}
3643
description={
3744
exampleData.author ? `by ${exampleData.author}` : undefined
3845
}

docs/components/ProBadge.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export function ProBadge() {
22
return (
3-
<span className="mx-1 inline-flex items-center text-nowrap rounded-full px-1.5 text-xs font-medium text-indigo-600 ring-1 ring-inset ring-indigo-600">
3+
<span className="inline-flex h-4 items-center text-nowrap rounded-full px-1.5 text-xs font-medium text-indigo-600 ring-1 ring-inset ring-indigo-600">
44
Pro
55
</span>
66
);

0 commit comments

Comments
 (0)