Skip to content

Commit a16257a

Browse files
committed
fix: Fix and scaffold some components
1 parent 2601315 commit a16257a

32 files changed

Lines changed: 3975 additions & 270 deletions

File tree

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import Link from 'next/link';
2+
import { ArrowLeft, Home } from 'lucide-react';
3+
import { Button } from '@/components/ui/button';
4+
5+
export default function BlogNotFound() {
6+
return (
7+
<div className='flex min-h-[80vh] items-center justify-center bg-[#030303]'>
8+
<div className='mx-auto max-w-md px-6 text-center'>
9+
<div className='mb-8'>
10+
<h1 className='mb-4 text-6xl font-bold text-white'>404</h1>
11+
<h2 className='mb-4 text-2xl font-semibold text-white'>
12+
Blog Post Not Found
13+
</h2>
14+
<p className='mb-8 text-[#B5B5B5]'>
15+
The blog post you're looking for doesn't exist or has been moved.
16+
</p>
17+
</div>
18+
19+
<div className='flex flex-col gap-4 sm:flex-row sm:justify-center'>
20+
<Button
21+
asChild
22+
variant='outline'
23+
className='border-[#2B2B2B] text-white hover:bg-[#2B2B2B]'
24+
>
25+
<Link href='/blog'>
26+
<ArrowLeft className='mr-2 h-4 w-4' />
27+
Back to Blog
28+
</Link>
29+
</Button>
30+
31+
<Button
32+
asChild
33+
className='bg-[#A7F950] text-black hover:bg-[#A7F950]/90'
34+
>
35+
<Link href='/'>
36+
<Home className='mr-2 h-4 w-4' />
37+
Go Home
38+
</Link>
39+
</Button>
40+
</div>
41+
</div>
42+
</div>
43+
);
44+
}

app/(landing)/blog/[slug]/page.tsx

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import React from 'react';
2+
import { Metadata } from 'next';
3+
import { notFound } from 'next/navigation';
4+
import BlogPostDetails from '../../../../components/landing-page/blog/BlogPostDetails';
5+
import { getBlogPost, getAllBlogPosts } from '@/lib/data/blog';
6+
import { generateBlogPostMetadata } from '@/lib/metadata';
7+
8+
export async function generateStaticParams() {
9+
const posts = await getAllBlogPosts();
10+
11+
return posts.map(post => ({
12+
slug: post.slug,
13+
}));
14+
}
15+
16+
export async function generateMetadata({
17+
params,
18+
}: {
19+
params: Promise<{ slug: string }>;
20+
}): Promise<Metadata> {
21+
const { slug } = await params;
22+
const post = await getBlogPost(slug);
23+
24+
if (!post) {
25+
return {
26+
title: 'Blog Post Not Found',
27+
description: 'The requested blog post could not be found.',
28+
};
29+
}
30+
31+
return generateBlogPostMetadata(post);
32+
}
33+
34+
const BlogPostPage = async ({
35+
params,
36+
}: {
37+
params: Promise<{ slug: string }>;
38+
}) => {
39+
const { slug } = await params;
40+
const post = await getBlogPost(slug);
41+
42+
if (!post) {
43+
notFound();
44+
}
45+
46+
return <BlogPostDetails post={post} />;
47+
};
48+
49+
export default BlogPostPage;

app/(landing)/blog/page.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
import React from 'react';
22
import { Metadata } from 'next';
33
import { generatePageMetadata } from '@/lib/metadata';
4+
import BlogHero from '@/components/landing-page/blog/BlogHero';
5+
import BlogGrid from '@/components/landing-page/blog/BlogGrid';
6+
import { getAllBlogPosts } from '@/lib/data/blog';
47

58
export const metadata: Metadata = generatePageMetadata('blog');
69

7-
const BlogPage = () => {
10+
const BlogPage = async () => {
11+
const posts = await getAllBlogPosts();
12+
const otherPosts = posts.slice(1);
13+
814
return (
9-
<div className='mt-10 text-center text-4xl font-bold text-white'>
10-
Blog Page
15+
<div className='min-h-screen bg-[#030303]'>
16+
<BlogHero />
17+
<BlogGrid posts={otherPosts} showLoadMore={false} />
1118
</div>
1219
);
1320
};

0 commit comments

Comments
 (0)