/** * Category Display — the tiles WooCommerce shows in place of (or alongside) * products whenever the shop's or a category's display mode includes * categories, plus the category page's own description. * * Which of the two a shop actually sees is set one row up, in Product * Catalog's "Catalog Display" (Shop page display / Category archive display) — * this section is only about how the tiles then look, which is why the note at * the foot links there rather than repeating those two settings here. * * Laid out as one group per decision — Layout, Category Image, Display * Elements, Ordering, Category Page — so the pane reads top to bottom as * "what shape, what picture, what text, what order, and what the category's * own page shows", rather than as one flat stack of unrelated switches. */ import { __ } from '@wordpress/i18n'; import { CheckboxControl } from '@wordpress/components'; import { LayoutGrid, Image as ImageIcon, Type, ArrowUpDown, FileText, } from 'lucide-react'; import FieldGroup from '../../../controls/field-group'; import InfoNote from '../../../controls/info-note'; import SelectField from '../../../controls/select-field'; import DesignGallery from '../../../controls/design-gallery'; import { ExtrasFields } from '../shared'; import type { WorkingSettings, SetPath, SectionExtra } from '../../../types'; import type { WooSchema } from '../types'; import SectionIntro from '../../../controls/section-intro'; interface CategorySectionProps { schema: WooSchema; working: WorkingSettings; setPath: SetPath; extras?: SectionExtra[]; /** * Customizer host only: jump to Product Catalog, which owns the two * display-mode settings that decide whether these tiles render at all. */ onNavigateCatalog?: () => void; } export default function CategorySection( { schema, working, setPath, extras, onNavigateCatalog, }: CategorySectionProps ) { const category = ( ( working?.woocommerce ?? {} ) as Record< string, any > ) .category as Record< string, any > | undefined; const tileStyle = ( category?.tile_style ?? 'stacked' ) as string; // The title-only layout has no thumbnail, so the crop and the image // toggle have nothing to act on — the group is dropped rather than left // showing controls that quietly do nothing. const hasImage = 'text' !== tileStyle; return (

{ __( 'Category Display', 'aureon' ) }

{ __( 'Customize how product categories appear in the shop and category grids.', 'aureon' ) }

setPath( 'woocommerce.category.tile_style', value ) } /> { hasImage && ( setPath( 'woocommerce.category.tile_ratio', value ) } /> ) } setPath( 'woocommerce.category.tile_title', checked ) } /> setPath( 'woocommerce.category.tile_count', checked ) } /> setPath( 'woocommerce.category.order', value ) } /> setPath( 'woocommerce.category.description', checked ) } /> { __( 'Category tiles only appear where the display mode includes categories — set that under Product Catalog → Catalog Display.', 'aureon' ) }
); }