feat: 补全剩余 6 个 StreamField Block 前端渲染 (ProductCard/Pricing/Timeline/Team/TechStack/Video)
- types/wagtail.ts 新增对应 6 个 Block 值类型接口及 StreamFieldBlock 联合类型分支 - 新建 6 个渲染组件:ProductCardGrid/Pricing/Timeline/Team/TechStack/Video,风格与既有 Block 一致 - BlockRenderer.tsx 映射表接入新组件,key 与后端 COMMON_BLOCKS 保持一致 - lint/build 均验证通过
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import type { TimelineBlockValue } from "@/types/wagtail";
|
||||
|
||||
export default function Timeline({ value }: { value: TimelineBlockValue }) {
|
||||
return (
|
||||
<section className="py-24">
|
||||
<div className="mx-auto max-w-4xl px-6">
|
||||
{value.heading && (
|
||||
<h2 className="mb-16 text-4xl font-bold text-slate-900">{value.heading}</h2>
|
||||
)}
|
||||
<ol className="relative space-y-10 border-l border-slate-200 pl-8">
|
||||
{value.items?.map((item, index) => (
|
||||
<li key={`${item.year}-${index}`} className="relative">
|
||||
<span className="absolute -left-[2.35rem] top-1 h-3 w-3 rounded-full bg-primary" />
|
||||
<div className="mb-1 text-lg font-semibold text-primary">
|
||||
{item.year}
|
||||
</div>
|
||||
<p className="text-slate-600">{item.event}</p>
|
||||
</li>
|
||||
))}
|
||||
</ol>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user