From 30eaec57707d481bceb29378872bb8b00cf2e80e Mon Sep 17 00:00:00 2001 From: Gigi Date: Wed, 15 Oct 2025 22:13:14 +0200 Subject: [PATCH] refactor: remove redundant handleHighlightClick from Explore - HighlightItem now handles navigation internally - Remove duplicate navigation logic from Explore component - Simplifies code and ensures consistent behavior across all highlight displays --- src/components/Explore.tsx | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/src/components/Explore.tsx b/src/components/Explore.tsx index e8fe4a2f..fae4c2ad 100644 --- a/src/components/Explore.tsx +++ b/src/components/Explore.tsx @@ -237,35 +237,6 @@ const Explore: React.FC = ({ relayPool, eventStore, settings, acti return `/a/${naddr}` } - const handleHighlightClick = (highlightId: string) => { - const highlight = highlights.find(h => h.id === highlightId) - if (!highlight) return - - // For nostr-native articles - if (highlight.eventReference) { - // Convert eventReference to naddr - if (highlight.eventReference.includes(':')) { - const parts = highlight.eventReference.split(':') - const kind = parseInt(parts[0]) - const pubkey = parts[1] - const identifier = parts[2] || '' - - const naddr = nip19.naddrEncode({ - kind, - pubkey, - identifier - }) - navigate(`/a/${naddr}`, { state: { highlightId, openHighlights: true } }) - } else { - // Already an naddr - navigate(`/a/${highlight.eventReference}`, { state: { highlightId, openHighlights: true } }) - } - } - // For web URLs - else if (highlight.urlReference) { - navigate(`/r/${encodeURIComponent(highlight.urlReference)}`, { state: { highlightId, openHighlights: true } }) - } - } // Classify highlights with levels based on user context and apply visibility filters const classifiedHighlights = useMemo(() => { @@ -357,7 +328,6 @@ const Explore: React.FC = ({ relayPool, eventStore, settings, acti key={highlight.id} highlight={highlight} relayPool={relayPool} - onHighlightClick={handleHighlightClick} /> ))}