Skip to content

Commit

Permalink
Remove duplicate HTML/body tags (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
slavingia authored Sep 29, 2024
2 parents 9b117cc + 96c0c77 commit 0f8e116
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 39 deletions.
1 change: 0 additions & 1 deletion app/(dashboard)/dashboard/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export default function DashboardLayout({
return (
<div className="flex flex-col min-h-[calc(100dvh-68px)] max-w-7xl mx-auto w-full">
<div className="flex flex-1 overflow-hidden h-full">
{/* Main content */}
<main className="flex-1 overflow-y-auto p-0 lg:p-4">{children}</main>
</div>
</div>
Expand Down
69 changes: 33 additions & 36 deletions app/(dashboard)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,45 +8,42 @@ import {
import Link from "next/link";
import { Toaster } from "@/components/ui/toaster";

const Logo = () => (
<span className="ml-2 font-semibold text-gray-900 flex items-center">
<span className="text-2xl transform scale-y-75">S</span>
<span className="text-xl">hortest</span>
</span>
);

export default function Layout({ children }: { children: React.ReactNode }) {
return (
<ClerkProvider>
<html lang="en">
<body>
<header className="border-b border-gray-200">
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4 flex justify-between items-center">
<SignedIn>
<Link href="/dashboard" className="flex items-center">
<span className="ml-2 font-semibold text-gray-900 flex items-center">
<span className="text-2xl transform scale-y-75">S</span>
<span className="text-xl">hortest</span>
</span>
</Link>
</SignedIn>
<SignedOut>
<Link href="/" className="flex items-center">
<span className="ml-2 font-semibold text-gray-900 flex items-center">
<span className="text-2xl transform scale-y-75">S</span>
<span className="text-xl">hortest</span>
</span>
</Link>
</SignedOut>
<div className="flex items-center space-x-4">
<SignedOut>
<Link href="/pricing">Pricing</Link>
<SignInButton />
</SignedOut>
<SignedIn>
<Link href="/dashboard/settings">Settings</Link>
<UserButton />
</SignedIn>
</div>
</div>
</header>
<main>{children}</main>
<Toaster />
</body>
</html>
<header className="border-b border-gray-200">
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4 flex justify-between items-center">
<SignedIn>
<Link href="/dashboard" className="flex items-center">
<Logo />
</Link>
</SignedIn>
<SignedOut>
<Link href="/" className="flex items-center">
<Logo />
</Link>
</SignedOut>
<div className="flex items-center space-x-4">
<SignedOut>
<Link href="/pricing">Pricing</Link>
<SignInButton />
</SignedOut>
<SignedIn>
<Link href="/dashboard/settings">Settings</Link>
<UserButton />
</SignedIn>
</div>
</div>
</header>
{children}
<Toaster />
</ClerkProvider>
);
}
4 changes: 2 additions & 2 deletions app/(dashboard)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Link from "next/link";

export default function HomePage() {
return (
<div className="main">
<main>
<section className="py-20">
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div className="text-center">
Expand Down Expand Up @@ -140,6 +140,6 @@ export default function HomePage() {
</div>
</div>
</section>
</div>
</main>
);
}

0 comments on commit 0f8e116

Please sign in to comment.