|
1 | 1 | import Header from "@/components/landingpage/header"; |
2 | 2 | import Footer from "@/components/landingpage/footer"; |
3 | | -import { Badge } from "@/components/ui/badge"; |
| 3 | +import type { ComponentProps } from "react"; |
| 4 | +import ReactMarkdown from "react-markdown"; |
| 5 | +import remarkGfm from "remark-gfm"; |
| 6 | +import { |
| 7 | + Breadcrumb, |
| 8 | + BreadcrumbItem, |
| 9 | + BreadcrumbLink, |
| 10 | + BreadcrumbList, |
| 11 | + BreadcrumbSeparator, |
| 12 | +} from "@/components/ui/breadcrumb"; |
| 13 | +import { Link, ArrowRight } from "lucide-react"; |
| 14 | +import { Separator } from "@/components/ui/separator"; |
4 | 15 | import { Button } from "@/components/ui/button"; |
5 | | -import { ArrowUpRight } from "lucide-react"; |
6 | | -import Image from "next/image"; |
7 | 16 |
|
8 | | -export type ChangelogEntry = { |
9 | | - version: string; |
10 | | - date: string; |
11 | | - title: string; |
12 | | - description: string; |
13 | | - items?: string[]; |
14 | | - image?: string; |
15 | | - button?: { |
16 | | - url: string; |
17 | | - text: string; |
18 | | - }; |
19 | | -}; |
20 | | - |
21 | | -const changelogEntries: ChangelogEntry[] = [ |
22 | | - { |
23 | | - version: "Version 1.0.0", |
24 | | - date: "24 October 2025", |
25 | | - title: "Initial Release - Form Builder Platform", |
26 | | - description: "We're excited to announce the launch of our comprehensive form builder platform. This initial release includes all the core features needed to create beautiful, responsive forms with drag-and-drop simplicity.", |
27 | | - items: [ |
28 | | - "Drag-and-drop form builder with intuitive interface", |
29 | | - "Comprehensive form component library (inputs, selects, checkboxes, etc.)", |
30 | | - "WYSIWYG text editor with rich formatting options", |
31 | | - "Icon picker with extensive icon library", |
32 | | - "Form validation system with real-time feedback", |
33 | | - "Template system with pre-designed form templates", |
34 | | - "User authentication and form management", |
35 | | - "Code generation for React components", |
36 | | - "Responsive design with container queries", |
37 | | - "JSON import/export functionality", |
38 | | - "Form examples and best practices", |
39 | | - "Mobile-optimized interface" |
40 | | - ], |
41 | | - button: { |
42 | | - url: "/builder", |
43 | | - text: "Try the Builder" |
44 | | - } |
| 17 | +async function fetchChangelog(): Promise<string> { |
| 18 | + // Use raw GitHub URL to fetch plain Markdown content |
| 19 | + const res = await fetch( |
| 20 | + "https://raw.githubusercontent.com/iduspara/shadcn-builder/refs/heads/main/CHANGELOG.md", |
| 21 | + { next: { revalidate: 60 } } |
| 22 | + ); |
| 23 | + if (!res.ok) { |
| 24 | + return "Failed to load changelog."; |
45 | 25 | } |
46 | | -]; |
| 26 | + return res.text(); |
| 27 | +} |
47 | 28 |
|
48 | | -export default function ChangelogPage() { |
| 29 | +export default async function ChangelogPage() { |
| 30 | + const markdown = await fetchChangelog(); |
49 | 31 | return ( |
50 | | - <div className="min-h-screen bg-background"> |
| 32 | + <div> |
51 | 33 | <Header /> |
52 | | - |
53 | | - <main className="pt-20"> |
54 | | - <section className="py-32"> |
55 | | - <div className="container"> |
56 | | - <div className="mx-auto max-w-3xl"> |
57 | | - <h1 className="mb-4 text-3xl font-bold tracking-tight md:text-5xl"> |
58 | | - Changelog |
59 | | - </h1> |
60 | | - <p className="text-muted-foreground mb-6 text-base md:text-lg"> |
61 | | - Get the latest updates and improvements to our platform. |
62 | | - </p> |
| 34 | + <main className="container mx-auto px-4 py-16 md:py-24 max-w-7xl"> |
| 35 | + <div className="space-y-8"> |
| 36 | + {/* Header */} |
| 37 | + <div className="space-y-4"> |
| 38 | + <Breadcrumb className="mb-4"> |
| 39 | + <BreadcrumbList> |
| 40 | + <BreadcrumbItem> |
| 41 | + <BreadcrumbLink href="/">Home</BreadcrumbLink> |
| 42 | + </BreadcrumbItem> |
| 43 | + <BreadcrumbSeparator /> |
| 44 | + <BreadcrumbItem> |
| 45 | + <BreadcrumbLink href="/changelog">Changelog</BreadcrumbLink> |
| 46 | + </BreadcrumbItem> |
| 47 | + </BreadcrumbList> |
| 48 | + </Breadcrumb> |
| 49 | + <div className="space-y-6"> |
| 50 | + <div className="flex items-center gap-3"> |
| 51 | + <div> |
| 52 | + <h1 className="text-4xl font-bold tracking-tight"> |
| 53 | + Changelog |
| 54 | + </h1> |
| 55 | + </div> |
| 56 | + </div> |
63 | 57 | </div> |
64 | | - <div className="mx-auto mt-16 max-w-3xl space-y-16 md:mt-24 md:space-y-24"> |
65 | | - {changelogEntries.map((entry, index) => ( |
66 | | - <div |
67 | | - key={index} |
68 | | - className="relative flex flex-col gap-4 md:flex-row md:gap-16" |
69 | | - > |
70 | | - <div className="top-8 flex h-min w-64 shrink-0 items-center gap-4 md:sticky"> |
71 | | - <Badge variant="secondary" className="text-xs"> |
72 | | - {entry.version} |
73 | | - </Badge> |
74 | | - <span className="text-muted-foreground text-xs font-medium"> |
75 | | - {entry.date} |
76 | | - </span> |
77 | | - </div> |
78 | | - <div className="flex flex-col"> |
79 | | - <h2 className="text-foreground/90 mb-3 text-lg font-bold leading-tight md:text-2xl"> |
80 | | - {entry.title} |
81 | | - </h2> |
82 | | - <p className="text-muted-foreground text-sm md:text-base"> |
83 | | - {entry.description} |
84 | | - </p> |
85 | | - {entry.items && entry.items.length > 0 && ( |
86 | | - <ul className="text-muted-foreground ml-4 mt-4 space-y-1.5 text-sm md:text-base"> |
87 | | - {entry.items.map((item, itemIndex) => ( |
88 | | - <li key={itemIndex} className="list-disc"> |
89 | | - {item} |
90 | | - </li> |
91 | | - ))} |
92 | | - </ul> |
93 | | - )} |
94 | | - {entry.image && ( |
95 | | - <Image |
96 | | - src={entry.image} |
97 | | - alt={`${entry.version} visual`} |
98 | | - width={800} |
99 | | - height={400} |
100 | | - className="mt-8 w-full rounded-lg object-cover" |
| 58 | + </div> |
| 59 | + |
| 60 | + <Separator /> |
| 61 | + |
| 62 | + <section className="space-y-6"> |
| 63 | + <article className="prose"> |
| 64 | + <ReactMarkdown |
| 65 | + remarkPlugins={[remarkGfm]} |
| 66 | + components={{ |
| 67 | + a(props: ComponentProps<"a">) { |
| 68 | + return ( |
| 69 | + <a |
| 70 | + {...props} |
| 71 | + target="_blank" |
| 72 | + rel="noopener noreferrer" |
| 73 | + className="underline hover:opacity-80" |
101 | 74 | /> |
102 | | - )} |
103 | | - {entry.button && ( |
104 | | - <Button variant="link" className="mt-4 self-end" asChild> |
105 | | - <a href={entry.button.url}> |
106 | | - {entry.button.text} <ArrowUpRight className="h-4 w-4" /> |
107 | | - </a> |
108 | | - </Button> |
109 | | - )} |
110 | | - </div> |
111 | | - </div> |
112 | | - ))} |
| 75 | + ); |
| 76 | + }, |
| 77 | + }} |
| 78 | + > |
| 79 | + {markdown} |
| 80 | + </ReactMarkdown> |
| 81 | + </article> |
| 82 | + </section> |
| 83 | + |
| 84 | + <div className="bg-dotted border rounded-lg p-8 text-center space-y-4 mt-12"> |
| 85 | + <h3 className="text-2xl font-semibold">Ready to start building?</h3> |
| 86 | + <p className="text-muted-foreground max-w-2xl mx-auto"> |
| 87 | + Take these components for a spin in our interactive form builder. |
| 88 | + Drag, drop, and customize to create the perfect form for your needs. |
| 89 | + </p> |
| 90 | + <div className="flex flex-col sm:flex-row gap-4 justify-center"> |
| 91 | + <Button size="lg" asChild> |
| 92 | + <a href="/builder"> |
| 93 | + Open Form Builder <ArrowRight className="h-4 w-4 ml-2" /> |
| 94 | + </a> |
| 95 | + </Button> |
| 96 | + <Button size="lg" variant="outline" asChild> |
| 97 | + <Link href="/templates"> |
| 98 | + Browse Templates |
| 99 | + </Link> |
| 100 | + </Button> |
113 | 101 | </div> |
114 | 102 | </div> |
115 | | - </section> |
| 103 | + </div> |
116 | 104 | </main> |
117 | | - |
118 | 105 | <Footer /> |
119 | 106 | </div> |
120 | 107 | ); |
|
0 commit comments