Merge version_1 into main

Merge version_1 into main
This commit was merged in pull request #1.
This commit is contained in:
2026-01-21 11:10:42 +00:00
2 changed files with 25 additions and 34 deletions

View File

@@ -2,42 +2,34 @@
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import ReactLenis from "lenis/react"; import ReactLenis from "lenis/react";
import BlogCardEleven from '@/components/sections/blog/BlogCardEleven'; import TestimonialCardTwo from '@/components/sections/testimonial/TestimonialCardTwo';
import FooterCard from '@/components/sections/footer/FooterCard'; import FooterCard from '@/components/sections/footer/FooterCard';
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider"; import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import NavbarStyleApple from '@/components/navbar/NavbarStyleApple/NavbarStyleApple'; import NavbarStyleApple from '@/components/navbar/NavbarStyleApple/NavbarStyleApple';
import { PawPrint } from 'lucide-react'; import { PawPrint, Facebook, Instagram, Twitter } from 'lucide-react';
type BlogPost = { type BlogPost = {
id: string; id: string;
title: string; name: string;
author: string; role: string;
description: string; testimonial: string;
tags: string[];
imageSrc?: string; imageSrc?: string;
imageAlt?: string; imageAlt?: string;
videoSrc?: string;
videoAriaLabel?: string;
onBlogClick?: () => void;
}; };
const defaultPosts: BlogPost[] = [ const defaultPosts: BlogPost[] = [
{ {
id: "1", title: "Finding Forever Homes: Success Stories from Happy Paws", author: "Sarah Mitchell", description: "Heartwarming stories of rescued animals finding their perfect families through our adoption program.", tags: ["Adoption", "Success Stories"], id: "1", name: "Finding Forever Homes", role: "Success Stories from Happy Paws", testimonial: "Heartwarming stories of rescued animals finding their perfect families through our adoption program. Discover how love transforms lives.", imageSrc: "/placeholders/placeholder1.webp", imageAlt: "Happy dog with new family"
imageSrc: "/placeholders/placeholder3.avif", imageAlt: "Happy dog with new family", onBlogClick: () => console.log("Blog 1 clicked"),
}, },
{ {
id: "2", title: "Pet Care Tips: Keeping Your Furry Friends Healthy", author: "Dr. Michael Chen", description: "Essential health and wellness tips from our veterinary team to ensure your pets live their best lives.", tags: ["Health", "Tips"], id: "2", name: "Pet Care Tips", role: "Keeping Your Furry Friends Healthy", testimonial: "Essential health and wellness tips from our veterinary team to ensure your pets live their best lives. Expert advice for new pet parents.", imageSrc: "/placeholders/placeholder1.webp", imageAlt: "Veterinarian examining a cat"
imageSrc: "/placeholders/placeholder4.webp", imageAlt: "Veterinarian examining a cat", onBlogClick: () => console.log("Blog 2 clicked"),
}, },
{ {
id: "3", title: "Volunteer Spotlight: Making a Difference Together", author: "Emma Rodriguez", description: "Meet our amazing volunteers who dedicate their time to helping animals in need find loving homes.", tags: ["Volunteers", "Community"], id: "3", name: "Volunteer Spotlight", role: "Making a Difference Together", testimonial: "Meet our amazing volunteers who dedicate their time to helping animals in need find loving homes. Community heroes making an impact.", imageSrc: "/placeholders/placeholder1.webp", imageAlt: "Volunteers playing with shelter dogs"
imageSrc: "/placeholders/placeholder3.avif", imageAlt: "Volunteers playing with shelter dogs", onBlogClick: () => console.log("Blog 3 clicked"),
}, },
{ {
id: "4", title: "Understanding Animal Behavior: A Guide for New Pet Parents", author: "Lisa Thompson", description: "Learn to decode your pet's behavior and build a stronger bond with your new four-legged family member.", tags: ["Behavior", "New Owners"], id: "4", name: "Animal Behavior Guide", role: "Understanding Your New Pet", testimonial: "Learn to decode your pet's behavior and build a stronger bond with your new four-legged family member. Professional training insights.", imageSrc: "/placeholders/placeholder1.webp", imageAlt: "Dog trainer working with a puppy"
imageSrc: "/placeholders/placeholder4.webp", imageAlt: "Dog trainer working with a puppy", onBlogClick: () => console.log("Blog 4 clicked"), }
},
]; ];
export default function BlogPage() { export default function BlogPage() {
@@ -59,7 +51,8 @@ export default function BlogPage() {
const url = `${apiUrl}/posts/${projectId}`; const url = `${apiUrl}/posts/${projectId}`;
const response = await fetch(url, { const response = await fetch(url, {
method: "GET", headers: { method: "GET", headers: {
"Content-Type": "application/json"}, "Content-Type": "application/json"
},
}); });
if (response.ok) { if (response.ok) {
@@ -67,9 +60,7 @@ export default function BlogPage() {
if (Array.isArray(data) && data.length > 0) { if (Array.isArray(data) && data.length > 0) {
const mappedPosts = data.map((post: any) => ({ const mappedPosts = data.map((post: any) => ({
id: post.id || String(Math.random()), id: post.id || String(Math.random()),
title: post.title || "Untitled", author: post.author?.name || "Anonymous", description: post.excerpt || post.content?.slice(0, 100) || "", tags: post.tags || ["General"], name: post.title || "Untitled", role: post.author?.name || "Happy Paws Story", testimonial: post.excerpt || post.content?.slice(0, 150) || "", imageSrc: post.imageUrl || "/placeholders/placeholder1.webp", imageAlt: post.imageAlt || post.title || ""
imageSrc: post.imageUrl || "/placeholders/placeholder3.avif", imageAlt: post.imageAlt || post.title || "", videoSrc: post.videoUrl,
videoAriaLabel: post.videoAriaLabel || post.title || "", onBlogClick: () => console.log(`Blog ${post.id} clicked`),
})); }));
setPosts(mappedPosts); setPosts(mappedPosts);
} }
@@ -104,21 +95,21 @@ export default function BlogPage() {
<NavbarStyleApple <NavbarStyleApple
brandName="Happy Paws" brandName="Happy Paws"
navItems={[ navItems={[
{"name":"Home","id":"hero"}, { name: "Home", id: "hero" },
{"name":"About","id":"about"}, { name: "About", id: "about" },
{"name":"Adopt","id":"featured"}, { name: "Adopt", id: "featured" },
{"name":"FAQ","id":"faq"}, { name: "FAQ", id: "faq" },
{"name":"Contact","id":"contact"} { name: "Contact", id: "contact" }
]} ]}
/> />
{isLoading ? ( {isLoading ? (
<div className="w-content-width mx-auto py-20 text-center"> <div className="w-content-width mx-auto py-20 text-center">
<p className="text-foreground">Loading posts...</p> <p className="text-foreground">Loading stories...</p>
</div> </div>
) : ( ) : (
<BlogCardEleven <TestimonialCardTwo
blogs={posts} testimonials={posts}
animationType="slide-up" animationType="slide-up"
title="Happy Paws Stories" title="Happy Paws Stories"
description="Discover heartwarming tales of rescue, care, and forever homes from our animal shelter community." description="Discover heartwarming tales of rescue, care, and forever homes from our animal shelter community."
@@ -133,9 +124,9 @@ export default function BlogPage() {
logoText="Happy Paws" logoText="Happy Paws"
copyrightText="© 2025 Happy Paws Shelter | Helping animals find forever homes" copyrightText="© 2025 Happy Paws Shelter | Helping animals find forever homes"
socialLinks={[ socialLinks={[
{"icon":"Facebook","href":"https://facebook.com/happypaws","ariaLabel":"Facebook"}, { icon: Facebook, href: "https://facebook.com/happypaws", ariaLabel: "Facebook" },
{"icon":"Instagram","href":"https://instagram.com/happypaws","ariaLabel":"Instagram"}, { icon: Instagram, href: "https://instagram.com/happypaws", ariaLabel: "Instagram" },
{"icon":"Twitter","href":"https://twitter.com/happypaws","ariaLabel":"Twitter"} { icon: Twitter, href: "https://twitter.com/happypaws", ariaLabel: "Twitter" }
]} ]}
/> />
</div> </div>

View File

@@ -1,4 +1,4 @@
"use client" "use client";
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider"; import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import NavbarStyleApple from '@/components/navbar/NavbarStyleApple/NavbarStyleApple'; import NavbarStyleApple from '@/components/navbar/NavbarStyleApple/NavbarStyleApple';