Cleaning up

This commit is contained in:
2025-05-15 16:53:21 -05:00
parent 5dcf2ed423
commit 40ab2d8450
10 changed files with 61 additions and 286 deletions

View File

@@ -6,7 +6,6 @@ import {
Avatar,
AvatarFallback,
AvatarImage,
Button,
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
@@ -17,16 +16,12 @@ import {
import { getSignedUrl, getProfile, signOut } from '@/lib/actions';
import type { Profile } from '@/utils/supabase';
import Link from 'next/link';
const AvatarDropdown = () => {
const router = useRouter();
const [profile, setProfile] = useState<Profile | undefined>(undefined);
const [signedUrl, setSignedUrl] = useState<string | undefined>(undefined);
const handleEditProfile = async () => {
router.push('/profile');
};
const handleSignOut = async () => {
await signOut();
};
@@ -78,14 +73,15 @@ const AvatarDropdown = () => {
<DropdownMenuLabel>{profile?.full_name}</DropdownMenuLabel>
<DropdownMenuSeparator />
<DropdownMenuItem asChild>
<Button onClick={handleEditProfile} variant={'secondary'} className='w-full text-left'>
<Link href='/profile' className='w-full justify-center'>
Edit profile
</Button>
</Link>
</DropdownMenuItem>
<DropdownMenuSeparator className='h-[2px]' />
<DropdownMenuItem asChild>
<Button onClick={handleSignOut} variant={'secondary'} className='w-full text-left'>
Sign out
</Button>
<button onClick={handleSignOut} className='w-full justify-center'>
Log out
</button>
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>