Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(site): complete #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 22 additions & 21 deletions app/blog/[slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
import { Badge } from "@/components/ui/badge";
import { notFound } from "next/navigation";
import { notFound } from "next/navigation"
import { Badge } from "@/components/ui/badge"

interface BlogPost {
slug: string;
title: string;
date: string;
content: string;
category: string;
slug: string
title: string
date: string
content: string
category: string
}

// Simulating an API call with a timeout
async function fetchBlogPost(slug: string): Promise<BlogPost | null> {
return new Promise((resolve) => {
setTimeout(() => {
const post = blogPosts.find((post) => post.slug === slug);
resolve(post || null);
}, 100); // 100ms timeout to simulate API call
});
const post = blogPosts.find((post) => post.slug === slug)
resolve(post || null)
}, 100) // 100ms timeout to simulate API call
})
}

export async function generateStaticParams() {
// In a real application, you would fetch this data from an API or database
return blogPosts.map((post) => ({
slug: post.slug,
}));
}))
}

export async function generateMetadata({ params }: { params: { slug: string } }) {
const post = await fetchBlogPost(params.slug);
const post = await fetchBlogPost(params.slug)

if (!post) {
return {
title: "Post Not Found",
};
}
}

return {
title: post.title,
};
}
}

const blogPosts: BlogPost[] = [
Expand Down Expand Up @@ -149,7 +149,7 @@ const blogPosts: BlogPost[] = [
<p>As the Ethereum ecosystem evolves, Manifold Finance remains committed to providing cutting-edge solutions that leverage the latest scaling technologies.</p>
`,
},
];
]

function CategoryBadge({ category }: { category: string }) {
return (
Expand All @@ -161,17 +161,18 @@ function CategoryBadge({ category }: { category: string }) {
: category === "Tutorial"
? "bg-green-500/10 text-green-500 hover:bg-green-500/20"
: "bg-purple-500/10 text-purple-500 hover:bg-purple-500/20"
}>
}
>
{category}
</Badge>
);
)
}

export default async function BlogPost({ params }: { params: { slug: string } }) {
const post = await fetchBlogPost(params.slug);
const post = await fetchBlogPost(params.slug)

if (!post) {
notFound();
notFound()
}

return (
Expand All @@ -192,5 +193,5 @@ export default async function BlogPost({ params }: { params: { slug: string } })
</article>
</div>
</div>
);
)
}
31 changes: 16 additions & 15 deletions app/blog/page.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import { Badge } from "@/components/ui/badge";
import Link from "next/link";
import Link from "next/link"
import { Badge } from "@/components/ui/badge"

interface BlogPost {
slug: string;
title: string;
date: string;
excerpt: string;
category: string;
slug: string
title: string
date: string
excerpt: string
category: string
}

// Simulating an API call with a timeout
async function fetchBlogPosts(): Promise<BlogPost[]> {
return new Promise((resolve) => {
setTimeout(() => {
resolve(blogPosts);
}, 100); // 100ms timeout to simulate API call
});
resolve(blogPosts)
}, 100) // 100ms timeout to simulate API call
})
}

const blogPosts: BlogPost[] = [
Expand Down Expand Up @@ -43,7 +43,7 @@ const blogPosts: BlogPost[] = [
"We share our thoughts on the future of Ethereum scaling solutions and how Manifold Finance is positioned to support the ecosystem.",
category: "Industry Insights",
},
];
]

function CategoryBadge({ category }: { category: string }) {
return (
Expand All @@ -55,14 +55,15 @@ function CategoryBadge({ category }: { category: string }) {
: category === "Tutorial"
? "bg-green-500/10 text-green-500 hover:bg-green-500/20"
: "bg-purple-500/10 text-purple-500 hover:bg-purple-500/20"
}>
}
>
{category}
</Badge>
);
)
}

export default async function BlogPage() {
const posts = await fetchBlogPosts();
const posts = await fetchBlogPosts()

return (
<div className="min-h-screen bg-background">
Expand All @@ -89,5 +90,5 @@ export default async function BlogPage() {
</div>
</div>
</div>
);
)
}
4 changes: 2 additions & 2 deletions app/case-studies/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BackgroundPaths } from "../components/background-paths";
import { BackgroundPaths } from "../components/background-paths"

export default function CaseStudiesPage() {
return (
Expand Down Expand Up @@ -26,5 +26,5 @@ export default function CaseStudiesPage() {
</div>
</main>
</div>
);
)
}
62 changes: 32 additions & 30 deletions app/changelog/page.tsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
import { Badge } from "@/components/ui/badge";
import { ArrowLeft, ArrowRight } from "lucide-react";
import Link from "next/link";
import { Badge } from "@/components/ui/badge"
import { ArrowLeft, ArrowRight } from "lucide-react"
import Link from "next/link"

interface ChangelogEntry {
date: string;
version: string;
platform: string;
title: string;
type: "public" | "beta" | "alpha";
changes: string[];
date: string
version: string
platform: string
title: string
type: "public" | "beta" | "alpha"
changes: string[]
previousRelease?: {
date: string;
version: string;
platform: string;
type: "public" | "beta" | "alpha";
};
date: string
version: string
platform: string
type: "public" | "beta" | "alpha"
}
nextRelease?: {
date: string;
version: string;
platform: string;
type: "public" | "beta" | "alpha";
};
date: string
version: string
platform: string
type: "public" | "beta" | "alpha"
}
}

const changelog: ChangelogEntry = {
Expand All @@ -46,7 +46,7 @@ const changelog: ChangelogEntry = {
platform: "Mobile",
type: "public",
},
};
}

function VersionBadge({ type }: { type: ChangelogEntry["type"] }) {
return (
Expand All @@ -58,10 +58,11 @@ function VersionBadge({ type }: { type: ChangelogEntry["type"] }) {
: type === "beta"
? "bg-yellow-500/10 text-yellow-500 hover:bg-yellow-500/20"
: "bg-blue-500/10 text-blue-500 hover:bg-blue-500/20"
}>
}
>
{type}
</Badge>
);
)
}

function ReleaseNavigation({
Expand All @@ -71,16 +72,17 @@ function ReleaseNavigation({
version,
platform,
}: {
type: "previous" | "next";
direction: "left" | "right";
date: string;
version: string;
platform: string;
type: "previous" | "next"
direction: "left" | "right"
date: string
version: string
platform: string
}) {
return (
<Link
href="#"
className="block p-6 rounded-lg border border-border bg-card hover:bg-accent transition-colors">
className="block p-6 rounded-lg border border-border bg-card hover:bg-accent transition-colors"
>
<div className="flex items-center gap-2 text-sm text-muted-foreground mb-4">
{direction === "left" && <ArrowLeft className="w-4 h-4" />}
{type === "previous" ? "Previous" : "Next"} release
Expand All @@ -93,7 +95,7 @@ function ReleaseNavigation({
</div>
</div>
</Link>
);
)
}

export default function ChangelogPage() {
Expand Down Expand Up @@ -157,5 +159,5 @@ export default function ChangelogPage() {
</article>
</div>
</div>
);
)
}
11 changes: 6 additions & 5 deletions app/components/api-endpoint.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { Button } from "@/components/ui/button"
import { Input } from "@/components/ui/input"

export function APIEndpoint() {
return (
<div className="bg-blackA3 rounded-lg p-6">
<h3 className="text-xl font-semibold mb-4 text-white">Public API Endpoint</h3>
<h3 className="text-xl font-semibold mb-4 text-white">Try Our SecureRPC API</h3>
<div className="flex items-center space-x-2">
<Input
type="text"
Expand All @@ -17,8 +17,9 @@ export function APIEndpoint() {
</Button>
</div>
<p className="mt-4 text-sm text-mauveA11">
Get started with our SecureRPC API for MEV Protection, and low latency network access.
Get started with our SecureRPC API for censorship resistant and privacy perserving network
connectivity.
</p>
</div>
);
)
}
Loading