feat(cms): remove hardcoded images — connect birthday, dyvolis, dino, home gallery to CMS globals
Some checks are pending
CI / Type Check (push) Waiting to run
CI / Lint (push) Waiting to run
CI / Unit Tests (push) Waiting to run
Deploy / Build & Push Image (push) Waiting to run
Deploy / Deploy to VPS (push) Blocked by required conditions

This commit is contained in:
Vadym Samoilenko 2026-06-03 15:07:27 +01:00
parent d327c841d7
commit f0df7f1026
4 changed files with 18 additions and 2 deletions

View file

@ -92,6 +92,7 @@ export default async function LocationDetailPage({ params }: Props) {
stat={location.heroStat ?? undefined}
statLabel={location.heroStatLabel ?? undefined}
tips={heroTips}
heroImageUrl={getMediaUrl(location.heroBackground as Media | undefined)}
/>
<DyvoLisGallery
quote={location.galleryQuote ?? undefined}

View file

@ -15,6 +15,7 @@ interface DyvoLisHeroProps {
stat?: string
statLabel?: string
tips?: string[]
heroImageUrl?: string | null
}
export function DyvoLisHero({
@ -23,7 +24,9 @@ export function DyvoLisHero({
stat = '60+',
statLabel = 'експонатів з безпечних для дітей матеріалів',
tips = DEFAULT_TIPS,
heroImageUrl,
}: DyvoLisHeroProps) {
const heroImg = heroImageUrl ?? HERO_IMG
return (
<section className="relative overflow-hidden" style={{ background: '#f1fbeb' }}>
{/* Left column — contained within max-width */}
@ -141,7 +144,7 @@ export function DyvoLisHero({
</div>
{/* Cat */}
<img
src={HERO_IMG}
src={heroImg}
alt="Топіарна фігура ДивоЛісу"
className="absolute"
style={{
@ -157,7 +160,7 @@ export function DyvoLisHero({
{/* Mobile: hero image below text */}
<div className="relative mx-auto max-w-[420px] lg:hidden" aria-hidden="true">
<img
src={HERO_IMG}
src={heroImg}
alt="Топіарна фігура ДивоЛісу"
className="w-full object-contain"
loading="eager"

View file

@ -11,6 +11,12 @@ export const BirthdayPage: GlobalConfig = {
versions: { max: 20, drafts: { autosave: { interval: 2000 } } },
fields: [
// Hero
{
name: 'heroImage',
type: 'upload',
relationTo: 'media',
label: 'Фото герою (фон)',
},
{
name: 'heroTitle',
type: 'text',

View file

@ -10,6 +10,12 @@ export const DyvoLisPage: GlobalConfig = {
hooks: { afterChange: [revalidateGlobalAfterChange] },
fields: [
// Hero section
{
name: 'heroImage',
type: 'upload',
relationTo: 'media',
label: 'Фото герою (фон)',
},
{
name: 'heroTitle',
type: 'text',