mirror of
https://github.com/dergigi/boris.git
synced 2025-12-18 15:14:20 +01:00
feat(ui): add 'Read now' button next to each URL in bookmarks\n\n- Display inline book-open icon button per URL\n- Clicking loads readability content in the right panel\n- Added styles for url rows and inline button
This commit is contained in:
@@ -21,7 +21,7 @@ import {
|
||||
faEyeSlash,
|
||||
faThumbtack
|
||||
} from '@fortawesome/free-solid-svg-icons'
|
||||
import { faChevronDown, faChevronUp } from '@fortawesome/free-solid-svg-icons'
|
||||
import { faChevronDown, faChevronUp, faBookOpen } from '@fortawesome/free-solid-svg-icons'
|
||||
import { useEventModel } from 'applesauce-react/hooks'
|
||||
import { Models } from 'applesauce-core'
|
||||
import { IndividualBookmark } from '../types/bookmarks'
|
||||
@@ -116,16 +116,23 @@ export const BookmarkItem: React.FC<BookmarkItemProps> = ({ bookmark, index, onS
|
||||
<div className="bookmark-urls">
|
||||
<h4>URLs:</h4>
|
||||
{extractedUrls.map((url, urlIndex) => (
|
||||
<a
|
||||
key={urlIndex}
|
||||
href={url}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="bookmark-url"
|
||||
onClick={(e) => { if (onSelectUrl) { e.preventDefault(); onSelectUrl(url) } }}
|
||||
>
|
||||
{url}
|
||||
</a>
|
||||
<div key={urlIndex} className="url-row">
|
||||
<a
|
||||
href={url}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="bookmark-url"
|
||||
>
|
||||
{url}
|
||||
</a>
|
||||
<button
|
||||
className="read-inline-btn"
|
||||
title="Read now"
|
||||
onClick={(e) => { e.preventDefault(); onSelectUrl?.(url) }}
|
||||
>
|
||||
<FontAwesomeIcon icon={faBookOpen} />
|
||||
</button>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -150,6 +150,25 @@ body {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.url-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.read-inline-btn {
|
||||
background: #28a745;
|
||||
color: white;
|
||||
border: none;
|
||||
padding: 0.25rem 0.5rem;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.read-inline-btn:hover {
|
||||
background: #218838;
|
||||
}
|
||||
|
||||
.bookmark-events {
|
||||
margin: 1rem 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user