'use client'; import * as Icons from '../Icons'; import OptionGrid, { toOptions } from '../fields/OptionGrid'; import { PHOTO_GRID_COLUMNS_MAX, PHOTO_GRID_COLUMNS_MIN, PHOTO_GRID_GAP_MAX, } from '@/lib/config/schema'; import type { SectionProps } from './types'; const LAYOUTS = ['masonry', 'uniform', 'showcase', 'filmstrip', 'editorial-flow', 'justified']; const ASPECT_RATIOS = ['1', '3/2', '2/3', '16/9', 'auto']; const LAYOUT_INFO: Record = { masonry: { label: 'Masonry', desc: 'Dynamic pinterest-style staggered columns', }, uniform: { label: 'Uniform Grid', desc: 'Clean equal aspect ratio grid' }, showcase: { label: 'Showcase', desc: 'Featured hero photos mixed with smaller tiles', }, filmstrip: { label: 'Filmstrip', desc: 'Horizontal scrollable film strip timeline', }, 'editorial-flow': { label: 'Editorial Flow', desc: 'Magazine story layout with varying photo sizes', }, justified: { label: 'Justified (Experimental)', desc: 'Equal-height rows that fill the full width', }, }; const LAYOUT_OPTIONS = toOptions(LAYOUTS, LAYOUT_INFO); function LayoutPreview({ value }: { value: string }) { return (
{value === 'masonry' && (
)} {value === 'uniform' && (
)} {value === 'showcase' && (
)} {value === 'filmstrip' && (
)} {value === 'editorial-flow' && (
)} {value === 'justified' && (
)}
); } const ASPECT_RATIO_INFO: Record = { '1': { label: 'Square (1:1)', desc: '1:1 ratio square crops' }, '3/2': { label: 'Landscape (3:2)', desc: 'Standard 35mm DSLR landscape' }, '2/3': { label: 'Portrait (2:3)', desc: 'Vertical portrait orientation' }, '16/9': { label: 'Cinema (16:9)', desc: 'Widescreen 16:9 cinematic ratio' }, auto: { label: 'Original Auto', desc: 'Uncropped original image proportions', }, }; const ASPECT_RATIO_OPTIONS = toOptions(ASPECT_RATIOS, ASPECT_RATIO_INFO); function AspectRatioPreview({ value }: { value: string }) { return (
); } export default function GridSection({ settings, update }: SectionProps) { return (

Grid & Layout Engine

Configure photography gallery column structures and thumbnail aspect ratios.

update('grid.layout', v)} cardClassName="grid-layout-card" renderPreview={(o) => } /> update('grid.aspectRatio', v)} cardClassName="ratio-card" renderPreview={(o) => } />

Spacing & Columns

Adjust column counts and grid gap spacing. The column count also tiles the album covers on a subpage; their spacing stays with the theme unless a page overrides it.

update('grid.columns', parseInt(e.target.value) || 3)} />
update('grid.gap', parseInt(e.target.value) || 0)} />
); }