mirror of
https://github.com/shadcn-ui/taxonomy
synced 2026-05-24 09:48:32 +00:00
Fix: issue #199
This commit is contained in:
parent
651f984e52
commit
f8b9380d36
1 changed files with 13 additions and 3 deletions
|
|
@ -5,7 +5,8 @@ import { cn } from "@/lib/utils"
|
|||
import { buttonVariants } from "@/components/ui/button"
|
||||
import { MainNav } from "@/components/main-nav"
|
||||
import { SiteFooter } from "@/components/site-footer"
|
||||
|
||||
import { getCurrentUser } from "@/lib/session"
|
||||
import { UserAccountNav } from "@/components/user-account-nav"
|
||||
interface MarketingLayoutProps {
|
||||
children: React.ReactNode
|
||||
}
|
||||
|
|
@ -13,13 +14,15 @@ interface MarketingLayoutProps {
|
|||
export default async function MarketingLayout({
|
||||
children,
|
||||
}: MarketingLayoutProps) {
|
||||
const user = await getCurrentUser()
|
||||
return (
|
||||
<div className="flex min-h-screen flex-col">
|
||||
<header className="container z-40 bg-background">
|
||||
<div className="flex h-20 items-center justify-between py-6">
|
||||
<MainNav items={marketingConfig.mainNav} />
|
||||
<nav>
|
||||
<Link
|
||||
{
|
||||
!user ? <Link
|
||||
href="/login"
|
||||
className={cn(
|
||||
buttonVariants({ variant: "secondary", size: "sm" }),
|
||||
|
|
@ -27,7 +30,14 @@ export default async function MarketingLayout({
|
|||
)}
|
||||
>
|
||||
Login
|
||||
</Link>
|
||||
</Link> : <UserAccountNav
|
||||
user={{
|
||||
name: user.name,
|
||||
image: user.image,
|
||||
email: user.email,
|
||||
}}
|
||||
/>
|
||||
}
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
|
|
|
|||
Loading…
Reference in a new issue