Skip to content

Commit 518639d

Browse files
committed
web: Add account tab that shows your email address
1 parent 558174d commit 518639d

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
'use client'
2+
3+
import { useSession } from 'next-auth/react'
4+
5+
import { ProfileSection } from './profile-section'
6+
7+
import { Badge } from '@/components/ui/badge'
8+
9+
export function AccountSection() {
10+
const { data: session } = useSession()
11+
const email = session?.user?.email
12+
13+
return (
14+
<ProfileSection
15+
description="Your account information and settings."
16+
>
17+
<div className="flex items-center gap-4 p-4 bg-muted/50 rounded-lg">
18+
<div className="flex-1 min-w-0">
19+
<p className="text-sm font-medium text-muted-foreground">Email</p>
20+
<p className="text-lg font-medium truncate">{email || '-'}</p>
21+
</div>
22+
<Badge variant="secondary">
23+
{session?.user?.email ? 'Verified' : 'Unverified'}
24+
</Badge>
25+
</div>
26+
</ProfileSection>
27+
)
28+
}

web/src/app/profile/page.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
'use client'
22

3-
import { CreditCard, Shield, Users, Key, Menu } from 'lucide-react'
3+
import { CreditCard, Shield, Users, Key, Menu, User } from 'lucide-react'
44
import { useRouter, useSearchParams } from 'next/navigation'
55
import { useSession } from 'next-auth/react'
66
import { useState, useEffect, Suspense } from 'react'
77

88

99
// Import components
10+
import { AccountSection } from './components/account-section'
1011
import { ApiKeysSection } from './components/api-keys-section'
1112
import { ProfileLoggedOut } from './components/logged-out'
1213
import { ReferralsSection } from './components/referrals-section'
@@ -44,6 +45,12 @@ const sections = [
4445
icon: Users,
4546
component: ReferralsSection,
4647
},
48+
{
49+
id: 'account',
50+
title: 'Account',
51+
icon: User,
52+
component: AccountSection,
53+
},
4754
]
4855

4956
function ProfileSidebar({

0 commit comments

Comments
 (0)