fix: hide my pages menu for logged in users

This commit is contained in:
Christel Westerberg
2024-08-22 09:01:04 +02:00
parent fca9ee78b7
commit df076f50f5
2 changed files with 15 additions and 2 deletions

View File

@@ -0,0 +1,13 @@
import { serverClient } from "@/lib/trpc/server"
import MyPagesSidebar from "@/components/MyPages/Sidebar"
export async function MyPagesNavigation() {
const user = await serverClient().user.name()
// Check if we have user, that means we are logged in andt the My Pages menu can show.
if (!user) {
return null
}
return <MyPagesSidebar />
}