File tree Expand file tree Collapse file tree 1 file changed +34
-10
lines changed
Expand file tree Collapse file tree 1 file changed +34
-10
lines changed Original file line number Diff line number Diff line change 11import Link from "next/link"
2-
2+ import { UserAccountNav } from "@/components/user-account-nav"
33import { marketingConfig } from "@/config/marketing"
44import { cn } from "@/lib/utils"
55import { buttonVariants } from "@/components/ui/button"
66import { MainNav } from "@/components/main-nav"
77import { SiteFooter } from "@/components/site-footer"
8+ import { getCurrentUser } from "@/lib/session"
89
910interface MarketingLayoutProps {
1011 children : React . ReactNode
@@ -13,21 +14,44 @@ interface MarketingLayoutProps {
1314export default async function MarketingLayout ( {
1415 children,
1516} : MarketingLayoutProps ) {
17+
18+
19+ let user : any ;
20+ getCurrentUser ( ) . then ( currentUser => {
21+ user = currentUser ;
22+ } ) ;
23+
24+
1625 return (
1726 < div className = "flex min-h-screen flex-col" >
1827 < header className = "container z-40 bg-background" >
1928 < div className = "flex h-20 items-center justify-between py-6" >
2029 < MainNav items = { marketingConfig . mainNav } />
2130 < nav >
22- < Link
23- href = "/login"
24- className = { cn (
25- buttonVariants ( { variant : "secondary" , size : "sm" } ) ,
26- "px-4"
27- ) }
28- >
29- Login
30- </ Link >
31+ {
32+ user
33+ ?
34+ < Link
35+ href = "/login"
36+ className = { cn (
37+ buttonVariants ( { variant : "secondary" , size : "sm" } ) ,
38+ "px-4"
39+ ) }
40+ >
41+ Login
42+ </ Link >
43+ :
44+ < div className = 'flex justify-center items-center gap-3' >
45+ < h3 > Welcome { user . name } </ h3 >
46+ < UserAccountNav
47+ user = { {
48+ name : user . name ,
49+ image : user . image ,
50+ email : user . email ,
51+ } }
52+ />
53+ </ div >
54+ }
3155 </ nav >
3256 </ div >
3357 </ header >
You can’t perform that action at this time.
0 commit comments