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

Layout shift fix #22

Open
wants to merge 2 commits into
base: main
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
22 changes: 11 additions & 11 deletions app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
import Link from "next/link"
import "./globals.css"
import { Inter } from "next/font/google"
import { ThemeProvider } from "@/components/theme-provider"
import { Analytics } from "@/components/analytics"
import { ModeToggle } from "@/components/mode-toggle"
import Link from "next/link";
import "./globals.css";
import { Inter } from "next/font/google";
import { ThemeProvider } from "@/components/theme-provider";
import { Analytics } from "@/components/analytics";
import { ModeToggle } from "@/components/mode-toggle";

const inter = Inter({ subsets: ["latin"] })
const inter = Inter({ subsets: ["latin"] });

export const metadata = {
title: "Create Next App",
description: "Generated by create next app",
}
};

interface RootLayoutProps {
children: React.ReactNode
children: React.ReactNode;
}

export default function RootLayout({ children }: RootLayoutProps) {
return (
<html lang="en">
<body
className={`antialiased min-h-screen bg-white dark:bg-slate-950 text-slate-900 dark:text-slate-50 ${inter.className}`}
className={`antialiased overflow-x-hidden overflow-y-auto w-screen min-h-screen bg-white dark:bg-slate-950 text-slate-900 dark:text-slate-50 ${inter.className}`}
>
<ThemeProvider attribute="class" defaultTheme="system" enableSystem>
<div className="max-w-2xl mx-auto py-10 px-4">
Expand All @@ -39,5 +39,5 @@ export default function RootLayout({ children }: RootLayoutProps) {
</ThemeProvider>
</body>
</html>
)
);
}
2 changes: 1 addition & 1 deletion app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Link from "next/link"

export default function Home() {
return (
<div className="prose dark:prose-invert">
<div className="prose dark:prose-invert ">
{allPosts.map((post) => (
<article key={post._id}>
<Link href={post.slug}>
Expand Down
2 changes: 1 addition & 1 deletion app/posts/[...slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default async function PostPage({ params }: PostProps) {
}

return (
<article className="py-6 prose dark:prose-invert">
<article className="py-6 prose dark:prose-invert overflow-x-hidden">
<h1 className="mb-2">{post.title}</h1>
{post.description && (
<p className="text-xl mt-0 text-slate-700 dark:text-slate-200">
Expand Down