Deploy
This commit is contained in:
@@ -0,0 +1,56 @@
|
|||||||
|
'use client'
|
||||||
|
|
||||||
|
import Image from 'next/image'
|
||||||
|
import { useVulaContent } from '@/hooks/useVulaContent'
|
||||||
|
|
||||||
|
interface PostItemData {
|
||||||
|
title?: string
|
||||||
|
excerpt?: string
|
||||||
|
body?: string
|
||||||
|
author?: string
|
||||||
|
category?: string
|
||||||
|
image?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function CommunityHighlightsSection() {
|
||||||
|
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-current border-t-transparent animate-spin" /></div>
|
||||||
|
}
|
||||||
|
|
||||||
|
if (items.length === 0) return null
|
||||||
|
|
||||||
|
return (
|
||||||
|
<section id="community-highlights" data-vula-section="communityhighlights" data-vula-cms="posts" className="bg-[#18181b] py-20">
|
||||||
|
<div className="mx-auto max-w-7xl px-4">
|
||||||
|
<div className="mb-10 flex flex-col gap-4 border-l-4 border-[#ea580c] pl-4">
|
||||||
|
<p className="text-sm font-bold uppercase tracking-[0.3em] text-[#ea580c]">Community / Hype</p>
|
||||||
|
<h2 className="max-w-2xl text-4xl font-black uppercase text-white md:text-6xl">The family <span className="text-[#fbbf24]">talks</span>.</h2>
|
||||||
|
</div>
|
||||||
|
<div className="grid gap-6 md:grid-cols-3">
|
||||||
|
{items.slice(0, 3).map((item) => {
|
||||||
|
const d = (item.data ?? {}) as PostItemData
|
||||||
|
return (
|
||||||
|
<article key={item.id} className="group border-2 border-[#fbbf24] bg-[#18181b] shadow-[6px_6px_0_0_#fbbf24] transition-all duration-200 ease-out hover:-translate-x-1 hover:-translate-y-1">
|
||||||
|
<div className="relative h-52 overflow-hidden border-b-2 border-[#fbbf24]">
|
||||||
|
{d.image ? (
|
||||||
|
<Image src={d.image} alt={d.title ?? 'Kasi Drip community post'} fill sizes="(max-width: 768px) 100vw, 33vw" className="object-cover transition-transform duration-500 ease-out group-hover:scale-105" />
|
||||||
|
) : (
|
||||||
|
<div className="flex h-full items-center justify-center bg-[#fbbf24] text-4xl font-black text-[#18181b]">KD</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<div className="p-5">
|
||||||
|
{d.category ? <span className="bg-[#ea580c] px-2 py-1 text-xs font-black uppercase text-white">{d.category}</span> : null}
|
||||||
|
{d.title ? <h3 className="mt-3 text-xl font-black uppercase text-white">{d.title}</h3> : null}
|
||||||
|
{d.excerpt ? <p className="mt-2 text-sm text-zinc-400">{d.excerpt}</p> : null}
|
||||||
|
{d.author ? <p className="mt-4 text-xs font-bold uppercase tracking-widest text-[#fbbf24]">{d.author}</p> : null}
|
||||||
|
</div>
|
||||||
|
</article>
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user