style: polish blog landing and cards
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { m } from "motion/react";
|
||||
import { m, useReducedMotion } from "motion/react";
|
||||
import { PostCard } from "./PostCard";
|
||||
import type { PostMeta } from "@/lib/posts";
|
||||
|
||||
@@ -19,11 +19,18 @@ interface PostListProps {
|
||||
}
|
||||
|
||||
export function PostList({ posts }: PostListProps) {
|
||||
const shouldReduceMotion = useReducedMotion();
|
||||
|
||||
return (
|
||||
<m.ul variants={listVariants} initial="hidden" animate="visible" className="space-y-8">
|
||||
{posts.map((post) => (
|
||||
<m.ul
|
||||
variants={shouldReduceMotion ? undefined : listVariants}
|
||||
initial={shouldReduceMotion ? false : "hidden"}
|
||||
animate="visible"
|
||||
className="space-y-6"
|
||||
>
|
||||
{posts.map((post, index) => (
|
||||
<li key={post.slug}>
|
||||
<PostCard {...post} index={posts.indexOf(post)} />
|
||||
<PostCard {...post} index={index} />
|
||||
</li>
|
||||
))}
|
||||
</m.ul>
|
||||
|
||||
Reference in New Issue
Block a user