Skip to content

Commit 53fcbc1

Browse files
committed
fix: replace hardcoded 'Free Plan' with dynamic tier label in TopNav
Reads tier from session.user.user_metadata.tier (set by Supabase JWT). Capitalizes first letter: 'free' -> 'Free Plan', 'pro' -> 'Pro Plan'. Falls back to 'Free Plan' when tier is not set. Previously showed 'Free Plan' for all users including Pro and Enterprise.
1 parent 3a5236d commit 53fcbc1

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

frontend/src/components/dashboard/TopNav.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ export function TopNav({ onToggleSidebar, sidebarCollapsed, onOpenCommandPalette
2424

2525
const userEmail = session?.user?.email || 'User'
2626
const userInitial = userEmail.charAt(0).toUpperCase()
27+
const userTier = (session?.user?.user_metadata?.tier as string) || 'free'
28+
const tierLabel = `${userTier.charAt(0).toUpperCase()}${userTier.slice(1)} Plan`
2729

2830
const toggleTheme = () => {
2931
setTheme(theme === 'dark' ? 'light' : 'dark')
@@ -97,7 +99,7 @@ export function TopNav({ onToggleSidebar, sidebarCollapsed, onOpenCommandPalette
9799
<DropdownMenuLabel className="font-normal">
98100
<div className="flex flex-col space-y-1">
99101
<p className="text-sm font-medium truncate">{userEmail}</p>
100-
<p className="text-xs text-muted-foreground">Free Plan</p>
102+
<p className="text-xs text-muted-foreground">{tierLabel}</p>
101103
</div>
102104
</DropdownMenuLabel>
103105
<DropdownMenuSeparator />

0 commit comments

Comments
 (0)