Update src/app/blog/page.tsx
This commit is contained in:
@@ -22,16 +22,16 @@ type BlogPost = {
|
|||||||
|
|
||||||
const defaultPosts: BlogPost[] = [
|
const defaultPosts: BlogPost[] = [
|
||||||
{
|
{
|
||||||
id: "1", category: "Design", title: "UX review presentations", excerpt: "How do you create compelling presentations that wow your colleagues and impress your managers?", imageSrc: "/placeholders/placeholder3.avif", imageAlt: "Abstract design with purple and silver tones", authorName: "Olivia Rhye", authorAvatar: "/placeholders/placeholder3.avif", date: "20 Jan 2025", onBlogClick: () => console.log("Blog 1 clicked"),
|
id: "1", category: "Design", title: "UX review presentations", excerpt: "How do you create compelling presentations that wow your colleagues and impress your managers?", imageSrc: "https://images.unsplash.com/photo-1552664730-d307ca884978?w=800&h=600&fit=crop", imageAlt: "Abstract design with purple and silver tones", authorName: "Olivia Rhye", authorAvatar: "https://images.unsplash.com/photo-1552664730-d307ca884978?w=200&h=200&fit=crop", date: "20 Jan 2025", onBlogClick: () => console.log("Blog 1 clicked"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "2", category: "Development", title: "Building scalable applications", excerpt: "Learn the best practices for building applications that can handle millions of users.", imageSrc: "/placeholders/placeholder4.webp", imageAlt: "Development workspace", authorName: "John Smith", authorAvatar: "/placeholders/placeholder4.webp", date: "18 Jan 2025", onBlogClick: () => console.log("Blog 2 clicked"),
|
id: "2", category: "Development", title: "Building scalable applications", excerpt: "Learn the best practices for building applications that can handle millions of users.", imageSrc: "https://images.unsplash.com/photo-1552664730-d307ca884978?w=800&h=600&fit=crop", imageAlt: "Development workspace", authorName: "John Smith", authorAvatar: "https://images.unsplash.com/photo-1552664730-d307ca884978?w=200&h=200&fit=crop", date: "18 Jan 2025", onBlogClick: () => console.log("Blog 2 clicked"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "3", category: "Marketing", title: "Content strategy essentials", excerpt: "Discover how to create a content strategy that drives engagement and conversions.", imageSrc: "/placeholders/placeholder3.avif", imageAlt: "Marketing strategy board", authorName: "Sarah Johnson", authorAvatar: "/placeholders/placeholder3.avif", date: "15 Jan 2025", onBlogClick: () => console.log("Blog 3 clicked"),
|
id: "3", category: "Marketing", title: "Content strategy essentials", excerpt: "Discover how to create a content strategy that drives engagement and conversions.", imageSrc: "https://images.unsplash.com/photo-1552664730-d307ca884978?w=800&h=600&fit=crop", imageAlt: "Marketing strategy board", authorName: "Sarah Johnson", authorAvatar: "https://images.unsplash.com/photo-1552664730-d307ca884978?w=200&h=200&fit=crop", date: "15 Jan 2025", onBlogClick: () => console.log("Blog 3 clicked"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "4", category: "Product", title: "Product management 101", excerpt: "Everything you need to know to become an effective product manager in 2025.", imageSrc: "/placeholders/placeholder4.webp", imageAlt: "Product planning session", authorName: "Mike Davis", authorAvatar: "/placeholders/placeholder4.webp", date: "12 Jan 2025", onBlogClick: () => console.log("Blog 4 clicked"),
|
id: "4", category: "Product", title: "Product management 101", excerpt: "Everything you need to know to become an effective product manager in 2025.", imageSrc: "https://images.unsplash.com/photo-1552664730-d307ca884978?w=800&h=600&fit=crop", imageAlt: "Product planning session", authorName: "Mike Davis", authorAvatar: "https://images.unsplash.com/photo-1552664730-d307ca884978?w=200&h=200&fit=crop", date: "12 Jan 2025", onBlogClick: () => console.log("Blog 4 clicked"),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -63,7 +63,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()),
|
||||||
category: post.category || "General", title: post.title || "Untitled", excerpt: post.excerpt || post.content.slice(0, 30) || "", imageSrc: post.imageUrl || "/placeholders/placeholder3.avif", imageAlt: post.imageAlt || post.title || "", authorName: post.author?.name || "Anonymous", authorAvatar: post.author?.avatar || "/placeholders/placeholder3.avif", date: post.date || post.createdAt || new Date().toLocaleDateString("en-GB", { day: "numeric", month: "short", year: "numeric" }),
|
category: post.category || "General", title: post.title || "Untitled", excerpt: post.excerpt || post.content.slice(0, 30) || "", imageSrc: post.imageUrl || "https://images.unsplash.com/photo-1552664730-d307ca884978?w=800&h=600&fit=crop", imageAlt: post.imageAlt || post.title || "", authorName: post.author?.name || "Anonymous", authorAvatar: post.author?.avatar || "https://images.unsplash.com/photo-1552664730-d307ca884978?w=200&h=200&fit=crop", date: post.date || post.createdAt || new Date().toLocaleDateString("en-GB", { day: "numeric", month: "short", year: "numeric" }),
|
||||||
onBlogClick: () => console.log(`Blog ${post.id} clicked`),
|
onBlogClick: () => console.log(`Blog ${post.id} clicked`),
|
||||||
}));
|
}));
|
||||||
setPosts(mappedPosts);
|
setPosts(mappedPosts);
|
||||||
@@ -131,7 +131,7 @@ export default function BlogPage() {
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
<FooterMedia
|
<FooterMedia
|
||||||
imageSrc="https://img.b2bpic.net/free-photo/cityscape-frankfurt-downtown-germany_1268-20913.jpg"
|
imageSrc="https://images.unsplash.com/photo-1552664730-d307ca884978?w=1200&h=800&fit=crop"
|
||||||
imageAlt="Brussels skyline"
|
imageAlt="Brussels skyline"
|
||||||
logoText="Pitchdrive"
|
logoText="Pitchdrive"
|
||||||
copyrightText="© 2025 Pitchdrive. All rights reserved. Based in Brussels, Belgium."
|
copyrightText="© 2025 Pitchdrive. All rights reserved. Based in Brussels, Belgium."
|
||||||
@@ -145,4 +145,4 @@ export default function BlogPage() {
|
|||||||
</ReactLenis>
|
</ReactLenis>
|
||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user