Shumiland/src/globals/Header.ts
Vadym Samoilenko 1cd20291d0 feat: wire all sections to Payload CMS + header dropdown + deploy config
- New collections: Locations, Reviews, BirthdayPackages
- New lib: getHomeData() — single cache-wrapped data fetch for homepage
- All sections now read from CMS with static fallbacks
- Header dropdown auto-populates 5 locations from Locations collection
- Seed API at /api/admin/seed creates all collections + uploads media
- docker-compose.prod.yml: replaced nginx/certbot with Traefik labels (shumi.ai-impress.com)
- Fixed image assignments: Locations 3-5 use gallery images (not news-bg)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-10 21:39:29 +01:00

41 lines
1.2 KiB
TypeScript

import type { GlobalConfig } from 'payload'
import { isAdminOrEditor } from '@/access/isAdminOrEditor'
import { revalidateGlobalAfterChange } from '@/hooks/revalidatePath'
export const Header: GlobalConfig = {
slug: 'header',
access: { read: () => true, update: isAdminOrEditor },
hooks: { afterChange: [revalidateGlobalAfterChange] },
fields: [
{ name: 'logo', type: 'upload', relationTo: 'media' },
{ name: 'logoAlt', type: 'text' },
{ name: 'ctaLabel', type: 'text' },
{ name: 'ctaHref', type: 'text' },
{
name: 'navLinks',
type: 'array',
fields: [
{ name: 'label', type: 'text' },
{ name: 'href', type: 'text' },
{ name: 'openInNewTab', type: 'checkbox', defaultValue: false },
{
name: 'autoChildrenFrom',
type: 'select',
options: [
{ label: 'None', value: 'none' },
{ label: 'Locations (auto)', value: 'locations' },
],
defaultValue: 'none',
},
{
name: 'children',
type: 'array',
fields: [
{ name: 'label', type: 'text' },
{ name: 'href', type: 'text' },
],
},
],
},
],
}