Skip to content

Commit 3ecaad8

Browse files
authored
fix(blog): container on blog list page broken (#1315)
![image](https://github.com/user-attachments/assets/68086a8b-bbd8-4490-8ec5-dcb2fd9f3245) Co-authored-by: Tyler <[email protected]>
1 parent 7d11341 commit 3ecaad8

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

packages/website/src/components/post-list.tsx

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import type { ReactNode } from 'react';
12
import { Link } from 'waku';
23

34
type PostListItemProps = {
@@ -69,3 +70,9 @@ export const PostList = ({
6970
))}
7071
</ul>
7172
);
73+
74+
export const PostListContainer = ({ children }: { children: ReactNode }) => (
75+
<div className="relative z-10 mx-auto w-full max-w-[80ch] pt-16 text-white lg:pt-36 xl:-right-[calc(296px/2)] 2xl:right-auto">
76+
{children}
77+
</div>
78+
);

packages/website/src/pages/blog/index.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,17 @@ import { Page } from '../../components/page';
55
import { Meta } from '../../components/meta';
66
import { getAuthor } from '../../lib/get-author';
77
import type { BlogFrontmatter } from '../../types';
8-
import { PostList } from '../../components/post-list';
8+
import { PostList, PostListContainer } from '../../components/post-list';
99

1010
export default async function BlogIndexPage() {
1111
const articles = await getArticles();
1212

1313
return (
1414
<Page>
1515
<Meta title="Waku blog" description="The official Waku developer blog." />
16-
<PostList posts={articles} path="blog" />
16+
<PostListContainer>
17+
<PostList posts={articles} path="blog" />
18+
</PostListContainer>
1719
</Page>
1820
);
1921
}

packages/website/src/pages/guides/index.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { compileMDX } from 'next-mdx-remote/rsc';
44
import { Page } from '../../components/page';
55
import { Meta } from '../../components/meta';
66
import type { BlogFrontmatter } from '../../types';
7-
import { PostList } from '../../components/post-list';
7+
import { PostList, PostListContainer } from '../../components/post-list';
88

99
export default async function BlogIndexPage() {
1010
const articles = await getArticles();
@@ -15,14 +15,14 @@ export default async function BlogIndexPage() {
1515
title="Waku guide"
1616
description="The guides for working with Waku."
1717
/>
18-
<div className="relative z-10 mx-auto w-full max-w-[80ch] pt-16 text-white lg:pt-36 xl:-right-[calc(296px/2)] 2xl:right-auto">
18+
<PostListContainer>
1919
<p className="bg-gray-950/90 mb-16 rounded-xl border border-gray-800 p-4 text-white sm:p-6 lg:p-12">
2020
Our guides walk through hosting instructions, framework behavior,
2121
developer tooling, and more! We will talk through unstable APIs here,
2222
so you can help experiment with our new and fun features.
2323
</p>
2424
<PostList posts={articles} path="guides" />
25-
</div>
25+
</PostListContainer>
2626
</Page>
2727
);
2828
}

0 commit comments

Comments
 (0)