diff --git a/components/Loyalty/Sidebar/MyPagesNavigation/index.tsx b/components/Loyalty/Sidebar/MyPagesNavigation/index.tsx new file mode 100644 index 000000000..19ea70405 --- /dev/null +++ b/components/Loyalty/Sidebar/MyPagesNavigation/index.tsx @@ -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 +} diff --git a/components/Loyalty/Sidebar/index.tsx b/components/Loyalty/Sidebar/index.tsx index 912d86e27..53f0137b8 100644 --- a/components/Loyalty/Sidebar/index.tsx +++ b/components/Loyalty/Sidebar/index.tsx @@ -1,7 +1,7 @@ import JsonToHtml from "@/components/JsonToHtml" -import SidebarMyPages from "@/components/MyPages/Sidebar" import JoinLoyaltyContact from "./JoinLoyalty" +import { MyPagesNavigation } from "./MyPagesNavigation" import styles from "./sidebar.module.css" @@ -38,7 +38,7 @@ export default function SidebarLoyalty({ blocks }: SidebarProps) { case SidebarTypenameEnum.LoyaltyPageSidebarDynamicContent: switch (block.dynamic_content.component) { case LoyaltySidebarDynamicComponentEnum.my_pages_navigation: - return + return default: return null }