Cleaning up
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user