|
|
|
@ -7,9 +7,9 @@ import { |
|
|
|
DropdownMenuSeparator, |
|
|
|
DropdownMenuSeparator, |
|
|
|
DropdownMenuTrigger |
|
|
|
DropdownMenuTrigger |
|
|
|
} from '@/components/ui/dropdown-menu' |
|
|
|
} from '@/components/ui/dropdown-menu' |
|
|
|
import { toProfile, toWallet } from '@/lib/link' |
|
|
|
import { toWallet } from '@/lib/link' |
|
|
|
import { formatPubkey, generateImageByPubkey } from '@/lib/pubkey' |
|
|
|
import { formatPubkey, generateImageByPubkey } from '@/lib/pubkey' |
|
|
|
import { useSecondaryPage } from '@/PageManager' |
|
|
|
import { usePrimaryPage, useSecondaryPage } from '@/PageManager' |
|
|
|
import { useNostr } from '@/providers/NostrProvider' |
|
|
|
import { useNostr } from '@/providers/NostrProvider' |
|
|
|
import { ArrowDownUp, LogIn, LogOut, UserRound, Wallet } from 'lucide-react' |
|
|
|
import { ArrowDownUp, LogIn, LogOut, UserRound, Wallet } from 'lucide-react' |
|
|
|
import { useState } from 'react' |
|
|
|
import { useState } from 'react' |
|
|
|
@ -32,6 +32,7 @@ function ProfileButton() { |
|
|
|
const { t } = useTranslation() |
|
|
|
const { t } = useTranslation() |
|
|
|
const { account, profile } = useNostr() |
|
|
|
const { account, profile } = useNostr() |
|
|
|
const pubkey = account?.pubkey |
|
|
|
const pubkey = account?.pubkey |
|
|
|
|
|
|
|
const { navigate } = usePrimaryPage() |
|
|
|
const { push } = useSecondaryPage() |
|
|
|
const { push } = useSecondaryPage() |
|
|
|
const [loginDialogOpen, setLoginDialogOpen] = useState(false) |
|
|
|
const [loginDialogOpen, setLoginDialogOpen] = useState(false) |
|
|
|
const [logoutDialogOpen, setLogoutDialogOpen] = useState(false) |
|
|
|
const [logoutDialogOpen, setLogoutDialogOpen] = useState(false) |
|
|
|
@ -59,7 +60,7 @@ function ProfileButton() { |
|
|
|
</Button> |
|
|
|
</Button> |
|
|
|
</DropdownMenuTrigger> |
|
|
|
</DropdownMenuTrigger> |
|
|
|
<DropdownMenuContent side="top"> |
|
|
|
<DropdownMenuContent side="top"> |
|
|
|
<DropdownMenuItem onClick={() => push(toProfile(pubkey))}> |
|
|
|
<DropdownMenuItem onClick={() => navigate('profile')}> |
|
|
|
<UserRound /> |
|
|
|
<UserRound /> |
|
|
|
{t('Profile')} |
|
|
|
{t('Profile')} |
|
|
|
</DropdownMenuItem> |
|
|
|
</DropdownMenuItem> |
|
|
|
|