mirror of
https://github.com/dergigi/boris.git
synced 2026-01-08 17:34:52 +01:00
feat: open highlights panel when clicking highlight in article
- Simple inline handler that opens panel if collapsed - Sets selected highlight ID - Clean, minimal implementation
This commit is contained in:
@@ -157,16 +157,6 @@ const Bookmarks: React.FC<BookmarksProps> = ({ relayPool, onLogout }) => {
|
||||
}
|
||||
}
|
||||
|
||||
const handleHighlightClick = (highlightId: string) => {
|
||||
console.log('Highlight clicked:', highlightId)
|
||||
setSelectedHighlightId(highlightId)
|
||||
// Open highlights panel if it's collapsed
|
||||
if (isHighlightsCollapsed) {
|
||||
console.log('Opening highlights panel')
|
||||
setIsHighlightsCollapsed(false)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (loading) {
|
||||
@@ -214,7 +204,10 @@ const Bookmarks: React.FC<BookmarksProps> = ({ relayPool, onLogout }) => {
|
||||
selectedUrl={selectedUrl}
|
||||
highlights={highlights}
|
||||
showUnderlines={showUnderlines}
|
||||
onHighlightClick={handleHighlightClick}
|
||||
onHighlightClick={(id) => {
|
||||
setSelectedHighlightId(id)
|
||||
if (isHighlightsCollapsed) setIsHighlightsCollapsed(false)
|
||||
}}
|
||||
selectedHighlightId={selectedHighlightId}
|
||||
/>
|
||||
)}
|
||||
@@ -230,7 +223,7 @@ const Bookmarks: React.FC<BookmarksProps> = ({ relayPool, onLogout }) => {
|
||||
onToggleUnderlines={setShowUnderlines}
|
||||
selectedHighlightId={selectedHighlightId}
|
||||
onRefresh={handleFetchHighlights}
|
||||
onHighlightClick={handleHighlightClick}
|
||||
onHighlightClick={setSelectedHighlightId}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user