From fd3446a2f596ae75b07284442e8aad43aecce3ea Mon Sep 17 00:00:00 2001 From: mkfain Date: Fri, 22 May 2026 00:11:36 -0500 Subject: [PATCH] Hide badges in edit profile, drop 'Add to sidebar' from profile menu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Edit profile (ProfileSettings) renders an interactive ProfileCard for the avatar/banner/bio editor. The card was showing the user's NIP-58 badge showcase grid, which doesn't belong on the edit form. Add a showBadges prop to ProfileCard (default true to preserve all other consumers — NoteCard, PostDetailPage, MusicArtistsTab, MusicDiscoverTab) and pass showBadges={false} from ProfileSettings. Profile 3-dots menu: drop the 'Add to sidebar / Remove from sidebar' row. Sidebar pinning is a feed-management feature that doesn't belong on a profile-action menu — add-to-list already covers the list-management use case. Cleans out the supporting machinery (addToSidebar / removeFromSidebar / orderedItems / sidebarId / isInSidebar / handleToggleSidebar) and the now-unused Trash2 and PanelLeft lucide icons. --- src/components/ProfileCard.tsx | 5 ++++- src/pages/ProfilePage.tsx | 21 +-------------------- src/pages/ProfileSettings.tsx | 1 + 3 files changed, 6 insertions(+), 21 deletions(-) diff --git a/src/components/ProfileCard.tsx b/src/components/ProfileCard.tsx index fc1763de..db43f58f 100644 --- a/src/components/ProfileCard.tsx +++ b/src/components/ProfileCard.tsx @@ -95,6 +95,8 @@ export interface ProfileCardProps { onRemoveAvatar?: () => void; /** Show NIP-05 row (default true) */ showNip05?: boolean; + /** Show NIP-58 badge showcase row (default true). */ + showBadges?: boolean; /** When provided, render an editable profile fields section below bio */ extraFields?: ProfileField[]; onExtraFieldsChange?: (fields: ProfileField[]) => void; @@ -107,6 +109,7 @@ export function ProfileCard({ onPickImage, onRemoveAvatar, showNip05 = true, + showBadges = true, extraFields, onExtraFieldsChange, }: ProfileCardProps) { @@ -332,7 +335,7 @@ export function ProfileCard({ {/* Badge showcase */} - {(badgeRefs.length > 0 || badgesLoading) && ( + {showBadges && (badgeRefs.length > 0 || badgesLoading) && (
({ diff --git a/src/pages/ProfilePage.tsx b/src/pages/ProfilePage.tsx index fa8bc134..7b106212 100644 --- a/src/pages/ProfilePage.tsx +++ b/src/pages/ProfilePage.tsx @@ -6,7 +6,7 @@ import { useNostr } from '@nostrify/react'; import { useInfiniteQuery, useQueryClient } from '@tanstack/react-query'; import { useSeoMeta } from '@unhead/react'; import { nip19 } from 'nostr-tools'; -import { Zap, ClipboardCopy, ExternalLink, VolumeX, Flag, Bitcoin, X, QrCode, Check, Copy, Loader2, Download, Trash2, RotateCcw, Mail, ListPlus, Award, PanelLeft } from 'lucide-react'; +import { Zap, ClipboardCopy, ExternalLink, VolumeX, Flag, Bitcoin, X, QrCode, Check, Copy, Loader2, Download, RotateCcw, Mail, ListPlus, Award } from 'lucide-react'; import { Avatar, AvatarImage, AvatarFallback } from '@/components/ui/avatar'; import { Button } from '@/components/ui/button'; @@ -104,9 +104,6 @@ function ProfileMoreMenu({ pubkey, displayName, open, onOpenChange, isOwnProfile const npubEncoded = useMemo(() => nip19.npubEncode(pubkey), [pubkey]); const { addMute, removeMute, isMuted } = useMuteList(); const userMuted = isMuted('pubkey', pubkey); - const { addToSidebar, removeFromSidebar, orderedItems } = useFeedSettings(); - const sidebarId = `nostr:${npubEncoded}`; - const isInSidebar = orderedItems.includes(sidebarId); const [reportOpen, setReportOpen] = useState(false); const [addToListOpen, setAddToListOpen] = useState(false); const [recoveryOpen, setRecoveryOpen] = useState(false); @@ -153,17 +150,6 @@ function ProfileMoreMenu({ pubkey, displayName, open, onOpenChange, isOwnProfile const handleReport = () => openAfterClose(setReportOpen); const handleAddToList = () => openAfterClose(setAddToListOpen); - const handleToggleSidebar = () => { - if (isInSidebar) { - removeFromSidebar(sidebarId); - toast({ title: 'Removed from sidebar' }); - } else { - addToSidebar(sidebarId); - toast({ title: 'Added to sidebar' }); - } - close(); - }; - const handleRecovery = () => openAfterClose(setRecoveryOpen); const handleGiveBadge = () => openAfterClose(setGiveBadgeOpen); const handleWriteLetter = () => { @@ -197,11 +183,6 @@ function ProfileMoreMenu({ pubkey, displayName, open, onOpenChange, isOwnProfile label="Add to list" onClick={handleAddToList} /> - : } - label={isInSidebar ? 'Remove from sidebar' : 'Add to sidebar'} - onClick={handleToggleSidebar} - />
{isOwnProfile && ( diff --git a/src/pages/ProfileSettings.tsx b/src/pages/ProfileSettings.tsx index a716c17a..b683eb1e 100644 --- a/src/pages/ProfileSettings.tsx +++ b/src/pages/ProfileSettings.tsx @@ -714,6 +714,7 @@ export function ProfileSettings() { onChange={handleCardChange} onPickImage={handlePickImage} onRemoveAvatar={() => form.setValue('picture', '', { shouldDirty: true })} + showBadges={false} /> {isUploading && (