Skip to content

Commit

Permalink
post must have id
Browse files Browse the repository at this point in the history
  • Loading branch information
v1xingyue committed Jan 11, 2025
1 parent dde0dec commit 31a3d1e
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions packages/page/src/pages/HomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,23 @@ export function HomePage() {
return (
<div className="container mx-auto px-4 py-8">
<div className="grid gap-6 md:grid-cols-2 lg:grid-cols-3">
{posts.map((post) => (
<Link
key={post.id}
to={`/module/${post.id}`}
className="group block p-6 rounded-xl border border-gray-200 dark:border-gray-800 hover:border-[#FF7A00] dark:hover:border-[#FF7A00] transition-colors"
>
<h2 className="text-xl font-semibold text-black dark:text-white group-hover:text-[#FF7A00] transition-colors mb-2">
{post.title}
</h2>
<p className="text-gray-600 dark:text-gray-400">
{post.description}
</p>
</Link>
))}
{posts.map(
(post) =>
post.id && (
<Link
key={post.id}
to={`/module/${post.id}`}
className="group block p-6 rounded-xl border border-gray-200 dark:border-gray-800 hover:border-[#FF7A00] dark:hover:border-[#FF7A00] transition-colors"
>
<h2 className="text-xl font-semibold text-black dark:text-white group-hover:text-[#FF7A00] transition-colors mb-2">
{post.title}
</h2>
<p className="text-gray-600 dark:text-gray-400">
{post.description}
</p>
</Link>
)
)}
</div>
</div>
);
Expand Down

0 comments on commit 31a3d1e

Please sign in to comment.