feat(cms): remove hardcoded images — connect birthday, dyvolis, dino, home gallery to CMS globals
This commit is contained in:
parent
d327c841d7
commit
f0df7f1026
4 changed files with 18 additions and 2 deletions
|
|
@ -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}
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue