Deploy
This commit is contained in:
@@ -0,0 +1,91 @@
|
|||||||
|
'use client'
|
||||||
|
|
||||||
|
import { useVulaContent } from "@/hooks/useVulaContent"
|
||||||
|
import Image from "next/image"
|
||||||
|
import Link from "next/link"
|
||||||
|
import Button from "@/components/ui/Button"
|
||||||
|
|
||||||
|
interface AdvertBanner {
|
||||||
|
id: string
|
||||||
|
data: {
|
||||||
|
title?: string
|
||||||
|
subtitle?: string
|
||||||
|
image?: string
|
||||||
|
cta_text?: string
|
||||||
|
cta_url?: string
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function DealBannerSection() {
|
||||||
|
const { items, loading } = useVulaContent("advert_banners")
|
||||||
|
|
||||||
|
if (loading) {
|
||||||
|
return (
|
||||||
|
<section className="bg-white py-20">
|
||||||
|
<div className="flex justify-center">
|
||||||
|
<div className="w-8 h-8 rounded-full border-2 border-[#ea580c] border-t-transparent animate-spin" />
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (items.length === 0) return null
|
||||||
|
|
||||||
|
const banner = (items as AdvertBanner[])[0]
|
||||||
|
const d = banner.data
|
||||||
|
|
||||||
|
return (
|
||||||
|
<section
|
||||||
|
id="promo-banner"
|
||||||
|
data-vula-section="dealbanner"
|
||||||
|
data-vula-cms="advert_banners"
|
||||||
|
className="bg-white border-t-[3px] border-b-[3px] border-[#ea580c]"
|
||||||
|
>
|
||||||
|
<div className="container mx-auto px-4 py-10 lg:py-12">
|
||||||
|
<div className="relative overflow-hidden border-[3px] border-[#101418] shadow-[8px_8px_0_0_#16a34a] bg-[#101418] lg:flex lg:items-center">
|
||||||
|
{d.image && (
|
||||||
|
<div className="lg:w-1/2 relative h-64 lg:h-80">
|
||||||
|
<Image
|
||||||
|
src={d.image}
|
||||||
|
alt={d.title || "Deal"}
|
||||||
|
fill
|
||||||
|
sizes="(max-width: 768px) 100vw, 50vw"
|
||||||
|
className="object-cover grayscale contrast-150"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
<div className={`p-8 lg:p-12 ${d.image ? "lg:w-1/2" : "w-full"}`}>
|
||||||
|
{d.title && (
|
||||||
|
<h2 className="text-3xl lg:text-5xl font-bold uppercase text-white tracking-tight mb-4">
|
||||||
|
{d.title}
|
||||||
|
</h2>
|
||||||
|
)}
|
||||||
|
{d.subtitle && (
|
||||||
|
<p className="text-[#d4af37] text-lg lg:text-xl font-medium mb-6">
|
||||||
|
{d.subtitle}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
<div className="flex flex-wrap gap-4">
|
||||||
|
{d.cta_text && (
|
||||||
|
<Link href={d.cta_url || "/products"}>
|
||||||
|
<Button
|
||||||
|
variant="default"
|
||||||
|
size="lg"
|
||||||
|
className="bg-[#ea580c] text-black font-bold border-[2px] border-white shadow-[4px_4px_0_0_#d4af37] hover:shadow-[2px_2px_0_0_#d4af37] transition-all duration-200 uppercase tracking-wide"
|
||||||
|
>
|
||||||
|
{d.cta_text}
|
||||||
|
</Button>
|
||||||
|
</Link>
|
||||||
|
)}
|
||||||
|
<Link href="/products">
|
||||||
|
<Button variant="outline" size="lg" className="border-white text-white hover:bg-white hover:text-black transition-all duration-200">
|
||||||
|
Shop Now
|
||||||
|
</Button>
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user