From 95f4b207d51f22f9118cb01b7e02d285f9d6d00a Mon Sep 17 00:00:00 2001 From: codytseng Date: Mon, 8 Sep 2025 09:21:46 +0800 Subject: [PATCH] fix: some bugs --- src/components/Sidebar/AccountButton.tsx | 7 ++++--- src/components/Tabs/index.tsx | 2 +- src/pages/secondary/SearchPage/index.tsx | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/Sidebar/AccountButton.tsx b/src/components/Sidebar/AccountButton.tsx index e8ef0a17..54a305db 100644 --- a/src/components/Sidebar/AccountButton.tsx +++ b/src/components/Sidebar/AccountButton.tsx @@ -7,9 +7,9 @@ import { DropdownMenuSeparator, DropdownMenuTrigger } from '@/components/ui/dropdown-menu' -import { toProfile, toWallet } from '@/lib/link' +import { toWallet } from '@/lib/link' import { formatPubkey, generateImageByPubkey } from '@/lib/pubkey' -import { useSecondaryPage } from '@/PageManager' +import { usePrimaryPage, useSecondaryPage } from '@/PageManager' import { useNostr } from '@/providers/NostrProvider' import { ArrowDownUp, LogIn, LogOut, UserRound, Wallet } from 'lucide-react' import { useState } from 'react' @@ -32,6 +32,7 @@ function ProfileButton() { const { t } = useTranslation() const { account, profile } = useNostr() const pubkey = account?.pubkey + const { navigate } = usePrimaryPage() const { push } = useSecondaryPage() const [loginDialogOpen, setLoginDialogOpen] = useState(false) const [logoutDialogOpen, setLogoutDialogOpen] = useState(false) @@ -59,7 +60,7 @@ function ProfileButton() { - push(toProfile(pubkey))}> + navigate('profile')}> {t('Profile')} diff --git a/src/components/Tabs/index.tsx b/src/components/Tabs/index.tsx index ebccb18d..73c1c515 100644 --- a/src/components/Tabs/index.tsx +++ b/src/components/Tabs/index.tsx @@ -98,7 +98,7 @@ export default function Tabs({ key={tab.value} ref={(el) => (tabRefs.current[index] = el)} className={cn( - `w-fit text-center py-2 px-6 my-1 font-semibold clickable cursor-pointer rounded-lg`, + `w-fit text-center py-2 px-6 my-1 font-semibold whitespace-nowrap clickable cursor-pointer rounded-lg`, value === tab.value ? '' : 'text-muted-foreground' )} onClick={() => { diff --git a/src/pages/secondary/SearchPage/index.tsx b/src/pages/secondary/SearchPage/index.tsx index 55d12ecd..83779e24 100644 --- a/src/pages/secondary/SearchPage/index.tsx +++ b/src/pages/secondary/SearchPage/index.tsx @@ -57,6 +57,7 @@ const SearchPage = forwardRef(({ index }: { index?: number }, ref) => { } + displayScrollToTopButton >