Update src/app/blog/page.tsx
This commit is contained in:
@@ -1,11 +1,9 @@
|
||||
"use client";
|
||||
|
||||
import ReactLenis from "lenis/react";
|
||||
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
|
||||
import { useBlogPosts } from "@/hooks/useBlogPosts";
|
||||
import { useBlogPosts, BlogPost } from "@/hooks/useBlogPosts";
|
||||
|
||||
import NavbarLayoutFloatingInline from '@/components/navbar/NavbarLayoutFloatingInline';
|
||||
import BlogCardOne from '@/components/sections/blog/BlogCardOne';
|
||||
import FooterMedia from '@/components/sections/footer/FooterMedia';
|
||||
|
||||
export default function BlogPage() {
|
||||
@@ -24,72 +22,77 @@ export default function BlogPage() {
|
||||
secondaryButtonStyle="layered"
|
||||
headingFontWeight="extrabold"
|
||||
>
|
||||
<ReactLenis root>
|
||||
<div id="nav" data-section="nav">
|
||||
<NavbarLayoutFloatingInline
|
||||
navItems={[
|
||||
{ name: "Home", id: "/" },
|
||||
{ name: "Menu", id: "/#featured-dishes" },
|
||||
{ name: "About Us", id: "/#about" },
|
||||
{ name: "Reviews", id: "/#reviews" },
|
||||
]}
|
||||
brandName="2 Dogs Pub"
|
||||
button={{ text: "Visit Us", href: "/#footer" }}
|
||||
className="py-4 md:py-6"
|
||||
navItemClassName="text-lg font-semibold"
|
||||
buttonClassName="px-6 py-3 text-lg font-bold"
|
||||
buttonTextClassName="tracking-wide"
|
||||
/>
|
||||
<div id="nav" data-section="nav">
|
||||
<NavbarLayoutFloatingInline
|
||||
navItems={[
|
||||
{ name: "Home", id: "/" },
|
||||
{ name: "Menu", id: "/#featured-dishes" },
|
||||
{ name: "About Us", id: "/#about" },
|
||||
{ name: "Reviews", id: "/#reviews" },
|
||||
]}
|
||||
brandName="2 Dogs Pub"
|
||||
button={{ text: "Visit Us", href: "/#footer" }}
|
||||
className="py-4 md:py-6"
|
||||
navItemClassName="text-lg font-semibold"
|
||||
buttonClassName="px-6 py-3 text-lg font-bold"
|
||||
buttonTextClassName="tracking-wide"
|
||||
/>
|
||||
</div>
|
||||
|
||||
{isLoading ? (
|
||||
<div className="w-full mx-auto py-20 text-center min-h-screen flex items-center justify-center">
|
||||
<p className="text-foreground">Loading posts...</p>
|
||||
</div>
|
||||
|
||||
{isLoading ? (
|
||||
<div className="w-content-width mx-auto py-20 text-center">
|
||||
<p className="text-foreground">Loading posts...</p>
|
||||
) : (
|
||||
<div id="blog" data-section="blog" className="py-16 md:py-24 bg-background text-foreground">
|
||||
<div className="max-w-screen-xl mx-auto px-4 md:px-8">
|
||||
<h2 className="text-4xl md:text-6xl font-extrabold text-center text-foreground">Latest Articles</h2>
|
||||
<p className="text-xl md:text-2xl mt-4 text-center max-w-2xl mx-auto text-foreground opacity-80">Insights and updates from our team</p>
|
||||
<div className="mt-12 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
|
||||
{posts.map((post: BlogPost) => (
|
||||
<a key={post.slug} href={`/blog/${post.slug}`} className="block rounded-lg shadow-xl overflow-hidden bg-card hover:scale-[1.02] transition-transform duration-300 ease-out">
|
||||
{post.coverImage && <img src={post.coverImage} alt={post.title} className="w-full h-48 object-cover" />}
|
||||
<div className="p-6">
|
||||
<h3 className="text-2xl font-semibold text-foreground">{post.title}</h3>
|
||||
{post.excerpt && <p className="mt-2 text-foreground opacity-80">{post.excerpt}</p>}
|
||||
{post.date && <p className="mt-4 text-sm text-foreground opacity-60">{new Date(post.date).toLocaleDateString()}</p>}
|
||||
</div>
|
||||
</a>
|
||||
))}
|
||||
</div>
|
||||
) : (
|
||||
<div id="blog" data-section="blog">
|
||||
<BlogCardOne
|
||||
posts={posts}
|
||||
title="Latest Articles"
|
||||
description="Insights and updates from our team"
|
||||
animationType="slide-up"
|
||||
textboxLayout="default"
|
||||
useInvertedBackground={false}
|
||||
carouselMode="buttons"
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div id="footer" data-section="footer">
|
||||
<FooterMedia
|
||||
imageSrc="https://img.b2bpic.net/free-photo/stone-walled-restaurant-top-lighting_140725-9731.jpg"
|
||||
imageAlt="Trendy downtown gastropub interior"
|
||||
columns={[
|
||||
{ title: "Location", items: [{ label: "123 Pub Street", href: "#" }] },
|
||||
{
|
||||
title: "Hours", items: [
|
||||
{ label: "Mon-Thu: 4 PM - 10 PM", href: "#" },
|
||||
{ label: "Fri-Sat: 12 PM - 12 AM", href: "#" },
|
||||
{ label: "Sun: 12 PM - 9 PM", href: "#" },
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "Social", items: [
|
||||
{ label: "Instagram", href: "#" },
|
||||
{ label: "Facebook", href: "#" },
|
||||
],
|
||||
},
|
||||
]}
|
||||
logoText="2 Dogs Pub"
|
||||
copyrightText="© 2024 2 Dogs Pub. All rights reserved."
|
||||
className="bg-background-accent text-foreground pt-16 md:pt-24"
|
||||
mediaWrapperClassName="h-64 md:h-96 w-full"
|
||||
logoTextClassName="text-4xl font-extrabold"
|
||||
columnTitleClassName="text-xl font-bold mb-4 text-primary-cta"
|
||||
columnItemClassName="text-lg mb-2"
|
||||
/>
|
||||
</div>
|
||||
</ReactLenis>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div id="footer" data-section="footer">
|
||||
<FooterMedia
|
||||
imageSrc="https://img.b2bpic.net/free-photo/stone-walled-restaurant-top-lighting_140725-9731.jpg"
|
||||
imageAlt="Trendy downtown gastropub interior"
|
||||
columns={[
|
||||
{ title: "Location", items: [{ label: "123 Pub Street", href: "#" }] },
|
||||
{
|
||||
title: "Hours", items: [
|
||||
{ label: "Mon-Thu: 4 PM - 10 PM", href: "#" },
|
||||
{ label: "Fri-Sat: 12 PM - 12 AM", href: "#" },
|
||||
{ label: "Sun: 12 PM - 9 PM", href: "#" },
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "Social", items: [
|
||||
{ label: "Instagram", href: "#" },
|
||||
{ label: "Facebook", href: "#" },
|
||||
],
|
||||
},
|
||||
]}
|
||||
logoText="2 Dogs Pub"
|
||||
copyrightText="© 2024 2 Dogs Pub. All rights reserved."
|
||||
className="bg-background-accent text-foreground pt-16 md:pt-24"
|
||||
mediaWrapperClassName="h-64 md:h-96 w-full"
|
||||
logoTextClassName="text-4xl font-extrabold"
|
||||
columnTitleClassName="text-xl font-bold mb-4 text-primary-cta"
|
||||
columnItemClassName="text-lg mb-2"
|
||||
/>
|
||||
</div>
|
||||
</ThemeProvider>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user