checkpoint: before i18n implementation
This commit is contained in:
@@ -5,9 +5,9 @@ import { BLOG_POSTS, BLOG_CATEGORIES } from "@/lib/blog-data"
|
||||
import BlogCard from "@/components/BlogCard"
|
||||
|
||||
export default function PostsGridSection() {
|
||||
const [activeCategory, setActiveCategory] = useState("All")
|
||||
const [activeCategory, setActiveCategory] = useState<(typeof BLOG_CATEGORIES)[number]>(BLOG_CATEGORIES[0])
|
||||
|
||||
const filtered = activeCategory === "All"
|
||||
const filtered = activeCategory === BLOG_CATEGORIES[0]
|
||||
? BLOG_POSTS
|
||||
: BLOG_POSTS.filter((p) => p.category === activeCategory)
|
||||
|
||||
@@ -15,7 +15,7 @@ export default function PostsGridSection() {
|
||||
<section className="section">
|
||||
<div className="w-layout-blockcontainer container-default w-container">
|
||||
<div data-w-id="41a231e8-d013-bd0a-0639-c179719a51f6" style={{ opacity: "0", filter: "blur(8px)" }} className="title-left-content-right align-center">
|
||||
<h2>All articles</h2>
|
||||
<h2>全部文章</h2>
|
||||
<div className="category-list-wrapper">
|
||||
<div role="list" className="category-list">
|
||||
{BLOG_CATEGORIES.map((cat) => (
|
||||
@@ -24,6 +24,7 @@ export default function PostsGridSection() {
|
||||
className={`category-link${activeCategory === cat ? " w--current" : ""}`}
|
||||
onClick={() => setActiveCategory(cat)}
|
||||
type="button"
|
||||
aria-pressed={activeCategory === cat}
|
||||
>
|
||||
{cat}
|
||||
</button>
|
||||
@@ -33,11 +34,17 @@ export default function PostsGridSection() {
|
||||
</div>
|
||||
<div className="mg-top-regular">
|
||||
<div data-w-id="e99a5296-8389-ce52-d99c-66f9d94e1815" style={{ opacity: "0", filter: "blur(8px)" }} className="w-dyn-list">
|
||||
<div role="list" className="blog-v1-grid w-dyn-items">
|
||||
{filtered.map((post) => (
|
||||
<BlogCard key={post.slug} post={post} variant="grid" />
|
||||
))}
|
||||
</div>
|
||||
{filtered.length > 0 ? (
|
||||
<div role="list" className="blog-v1-grid w-dyn-items">
|
||||
{filtered.map((post) => (
|
||||
<BlogCard key={post.slug} post={post} variant="grid" />
|
||||
))}
|
||||
</div>
|
||||
) : (
|
||||
<div className="inner-container _430px">
|
||||
<p>这个分类下的内容还在整理中,先看看其他文章。</p>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user