feat: hide citation in highlights sidebar for current article

- Add showCitation prop to HighlightItem (defaults to true)
- Set showCitation={false} in HighlightsPanel
- Reduces redundancy since all sidebar highlights are from same article
- Citation still shown in Explore and Me pages where context is needed
This commit is contained in:
Gigi
2025-10-14 11:52:29 +02:00
parent b162596013
commit 820daa489e
2 changed files with 10 additions and 5 deletions

View File

@@ -31,6 +31,7 @@ interface HighlightItemProps {
eventStore?: IEventStore | null
onHighlightUpdate?: (highlight: Highlight) => void
onHighlightDelete?: (highlightId: string) => void
showCitation?: boolean
}
export const HighlightItem: React.FC<HighlightItemProps> = ({
@@ -41,7 +42,8 @@ export const HighlightItem: React.FC<HighlightItemProps> = ({
relayPool,
eventStore,
onHighlightUpdate,
onHighlightDelete
onHighlightDelete,
showCitation = true
}) => {
const itemRef = useRef<HTMLDivElement>(null)
const menuRef = useRef<HTMLDivElement>(null)
@@ -343,10 +345,12 @@ export const HighlightItem: React.FC<HighlightItemProps> = ({
{highlight.content}
</blockquote>
<HighlightCitation
highlight={highlight}
relayPool={relayPool}
/>
{showCitation && (
<HighlightCitation
highlight={highlight}
relayPool={relayPool}
/>
)}
{highlight.comment && (
<div className="highlight-comment">

View File

@@ -162,6 +162,7 @@ export const HighlightsPanel: React.FC<HighlightsPanelProps> = ({
eventStore={eventStore}
onHighlightUpdate={handleHighlightUpdate}
onHighlightDelete={handleHighlightDelete}
showCitation={false}
/>
))}
</div>