Skip to content

Commit 3e4b8d9

Browse files
committed
docs(gallery): switch masonry columns to lg breakpoint
1 parent 4b1dae6 commit 3e4b8d9

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

app/docs/gallery/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { ItemCarousel } from "@/components/tool-ui/item-carousel";
1414
import { OrderSummary } from "@/components/tool-ui/order-summary";
1515
import { StatsDisplay } from "@/components/tool-ui/stats-display";
1616
import { type GalleryComponentDocId } from "@/lib/docs/gallery-component-docs";
17+
import { GALLERY_COLUMNS_CLASS } from "@/lib/docs/gallery-layout";
1718
import { approvalCardPresets } from "@/lib/presets/approval-card";
1819
import { audioPresets } from "@/lib/presets/audio";
1920
import { chartPresets } from "@/lib/presets/chart";
@@ -359,7 +360,7 @@ export default function ComponentsGalleryPage() {
359360
>
360361
<h1 className="sr-only">Tool UI Component Gallery</h1>
361362
<GalleryPageAnalytics />
362-
<div className="mx-auto w-full min-w-0 max-w-full columns-1 gap-5 overflow-x-hidden pb-20 [column-fill:balance] md:columns-2">
363+
<div className={GALLERY_COLUMNS_CLASS}>
363364
{galleryCards.map((card) => (
364365
<GalleryPreviewCard
365366
key={card.componentId}

lib/docs/gallery-layout.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export const GALLERY_COLUMNS_CLASS =
2+
"mx-auto w-full min-w-0 max-w-full columns-1 gap-5 overflow-x-hidden pb-20 [column-fill:balance] lg:columns-2";
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { describe, expect, test } from "vitest";
2+
3+
import { GALLERY_COLUMNS_CLASS } from "@/lib/docs/gallery-layout";
4+
5+
describe("gallery page layout", () => {
6+
test("keeps a single column below the lg breakpoint (~1024px)", () => {
7+
expect(GALLERY_COLUMNS_CLASS).toContain("columns-1");
8+
expect(GALLERY_COLUMNS_CLASS).toContain("lg:columns-2");
9+
expect(GALLERY_COLUMNS_CLASS).toContain("w-full");
10+
expect(GALLERY_COLUMNS_CLASS).not.toContain("md:columns-2");
11+
});
12+
});

0 commit comments

Comments
 (0)