Deploy
This commit is contained in:
@@ -0,0 +1,56 @@
|
|||||||
|
'use client'
|
||||||
|
|
||||||
|
import Image from 'next/image'
|
||||||
|
import Badge from '@/components/ui/Badge'
|
||||||
|
import { useVulaContent } from '@/hooks/useVulaContent'
|
||||||
|
|
||||||
|
export default function ArtisanStoriesSection() {
|
||||||
|
const { items, loading } = useVulaContent('posts')
|
||||||
|
|
||||||
|
if (loading) {
|
||||||
|
return (
|
||||||
|
<div className="flex justify-center py-16">
|
||||||
|
<div className="w-8 h-8 rounded-full border-2 border-[#ea580c] border-t-transparent animate-spin" />
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (items.length === 0) return null
|
||||||
|
|
||||||
|
return (
|
||||||
|
<section id="artisan-stories" data-vula-section="artisanstories" data-vula-cms="posts" className="bg-[#f9f5f4] py-20">
|
||||||
|
<div className="mx-auto max-w-7xl px-4">
|
||||||
|
<div className="mb-12 flex flex-col gap-4 md:flex-row md:items-end md:justify-between">
|
||||||
|
<div className="max-w-2xl">
|
||||||
|
<p className="text-sm font-semibold uppercase tracking-[0.2em] text-[#6b8e23]">Women of Nongoma, Bulwer, Impendle & Hluhluwe</p>
|
||||||
|
<h2 className="mt-2 font-display text-3xl md:text-5xl text-[#21140d]">Stories stitched into every weave</h2>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="grid gap-8">
|
||||||
|
{items.map((item, index) => {
|
||||||
|
const d = item.data as { title?: string; excerpt?: string; body?: string; author?: string; category?: string; image?: string }
|
||||||
|
const flip = index % 2 === 1
|
||||||
|
return (
|
||||||
|
<article key={item.id} className="grid items-center gap-8 md:grid-cols-2">
|
||||||
|
<div className={`relative aspect-[4/3] overflow-hidden rounded-2xl ${flip ? 'md:order-2' : ''}`}>
|
||||||
|
{d?.image ? (
|
||||||
|
<Image src={d.image} alt={d.title || 'Artisan story'} fill sizes="(max-width: 768px) 100vw, 50vw" className="object-cover transition-transform duration-500 ease-out hover:scale-105" />
|
||||||
|
) : (
|
||||||
|
<div className="h-full bg-[#e2d9d4]" />
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<div className={flip ? 'md:order-1' : ''}>
|
||||||
|
{d?.category && <Badge variant="accent">{d.category}</Badge>}
|
||||||
|
<h3 className="mt-3 font-display text-2xl text-[#21140d]">{d?.title}</h3>
|
||||||
|
<p className="mt-3 text-[#36454F]">{d?.excerpt}</p>
|
||||||
|
{d?.author && <p className="mt-4 text-sm font-semibold text-[#ea580c]">By {d.author}</p>}
|
||||||
|
</div>
|
||||||
|
</article>
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user