Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Update app-sidebar-nav.tsx

Steven Teye70ce6adffa1
diff --git a/apps/web/ui/layout/sidebar/app-sidebar-nav.tsx b/apps/web/ui/layout/sidebar/app-sidebar-nav.tsx
index 3250a56561..482a89a4a6 100644
--- a/apps/web/ui/layout/sidebar/app-sidebar-nav.tsx
+++ b/apps/web/ui/layout/sidebar/app-sidebar-nav.tsx
@@ -20,6 +20,8 @@ import {
Users6,
Webhook,
} from "@dub/ui/src/icons";
+import { Session } from "next-auth";
+import { useSession } from "next-auth/react";
import { useParams, usePathname } from "next/navigation";
import { ReactNode, useMemo } from "react";
import UserSurveyButton from "../user-survey";
@@ -36,6 +38,7 @@ const NAV_AREAS: SidebarNavAreas<{
queryString: string;
flags?: Record<BetaFeatures, boolean>;
programs?: { id: string }[];
+ session?: Session | null;
}> = {
// Top-level
default: ({ slug, queryString, programs }) => ({
@@ -209,7 +212,7 @@ const NAV_AREAS: SidebarNavAreas<{
}),
// User settings
- userSettings: ({ slug }) => ({
+ userSettings: ({ session, slug }) => ({
title: "Settings",
backHref: `/${slug}`,
content: [
@@ -250,6 +253,7 @@ export function AppSidebarNav({
const { flags } = useWorkspace();
const { programs } = usePrograms();
const { getQueryString } = useRouterStuff();
+ const { data: session } = useSession();
const currentArea = useMemo(() => {
return pathname.startsWith("/account/settings")
@@ -268,6 +272,7 @@ export function AppSidebarNav({
queryString: getQueryString(),
flags,
programs,
+ session: session || undefined,
}}
toolContent={toolContent}
newsContent={newsContent}