fix(blog): optimize component share logic, typography, and modal layouts
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 5s
Build & Deploy / 🏗️ Build (push) Failing after 14s
Build & Deploy / 🧪 QA (push) Failing after 1m48s
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🩺 Health Check (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 2s
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 5s
Build & Deploy / 🏗️ Build (push) Failing after 14s
Build & Deploy / 🧪 QA (push) Failing after 1m48s
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🩺 Health Check (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 2s
This commit is contained in:
22
apps/web/app/api/tweet/[id]/route.ts
Normal file
22
apps/web/app/api/tweet/[id]/route.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { NextResponse } from 'next/server';
|
||||
import { getTweet } from 'react-tweet/api';
|
||||
|
||||
export async function GET(
|
||||
request: Request,
|
||||
{ params }: { params: Promise<{ id: string }> }
|
||||
) {
|
||||
const { id } = await params;
|
||||
|
||||
try {
|
||||
const tweet = await getTweet(id);
|
||||
|
||||
if (!tweet) {
|
||||
return NextResponse.json({ error: 'Tweet not found' }, { status: 404 });
|
||||
}
|
||||
|
||||
return NextResponse.json({ data: tweet });
|
||||
} catch (error) {
|
||||
console.error('Error fetching tweet:', error);
|
||||
return NextResponse.json({ error: 'Failed to fetch tweet' }, { status: 500 });
|
||||
}
|
||||
}
|
||||
@@ -8,8 +8,7 @@ import { Reveal } from "../../../src/components/Reveal";
|
||||
import { BlogPostClient } from "../../../src/components/BlogPostClient";
|
||||
import { TextSelectionShare } from "../../../src/components/TextSelectionShare";
|
||||
import { BlogPostStickyBar } from "../../../src/components/blog/BlogPostStickyBar";
|
||||
import { MDXRemote } from "next-mdx-remote/rsc";
|
||||
import { MDXComponents } from "../../../mdx-components";
|
||||
import { MDXContent } from "../../../src/components/MDXContent";
|
||||
|
||||
export async function generateStaticParams() {
|
||||
return allPosts.map((post) => ({
|
||||
@@ -74,6 +73,7 @@ export default async function BlogPostPage({
|
||||
date={formattedDate}
|
||||
readingTime={readingTime}
|
||||
slug={slug}
|
||||
thumbnail={post.thumbnail}
|
||||
/>
|
||||
|
||||
<main id="post-content">
|
||||
@@ -99,10 +99,7 @@ export default async function BlogPostPage({
|
||||
)}
|
||||
|
||||
<div className="article-content max-w-none">
|
||||
<MDXRemote
|
||||
source={post.body.raw.replace(/^---[\s\S]*?\n---\s*/, '')}
|
||||
components={MDXComponents}
|
||||
/>
|
||||
<MDXContent code={post.body.code} />
|
||||
</div>
|
||||
</Reveal>
|
||||
</div>
|
||||
|
||||
@@ -33,10 +33,6 @@ export default function RootLayout({
|
||||
}) {
|
||||
return (
|
||||
<html lang="en" className={`${inter.variable} ${newsreader.variable}`}>
|
||||
<head>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="anonymous" />
|
||||
</head>
|
||||
<body className="min-h-screen bg-white">
|
||||
<Header />
|
||||
<main>
|
||||
|
||||
Reference in New Issue
Block a user