File tree Expand file tree Collapse file tree 3 files changed +16
-1
lines changed
Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import { ItemCarousel } from "@/components/tool-ui/item-carousel";
1414import { OrderSummary } from "@/components/tool-ui/order-summary" ;
1515import { StatsDisplay } from "@/components/tool-ui/stats-display" ;
1616import { type GalleryComponentDocId } from "@/lib/docs/gallery-component-docs" ;
17+ import { GALLERY_COLUMNS_CLASS } from "@/lib/docs/gallery-layout" ;
1718import { approvalCardPresets } from "@/lib/presets/approval-card" ;
1819import { audioPresets } from "@/lib/presets/audio" ;
1920import { 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 }
Original file line number Diff line number Diff line change 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" ;
Original file line number Diff line number Diff line change 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+ } ) ;
You can’t perform that action at this time.
0 commit comments