mirror of
https://github.com/dergigi/boris.git
synced 2025-12-19 23:54:23 +01:00
feat: add Copy Link and Copy Original options to article menu
This commit is contained in:
@@ -290,6 +290,28 @@ const ContentPanel: React.FC<ContentPanelProps> = ({
|
||||
}
|
||||
}
|
||||
|
||||
const handleCopyBoris = async () => {
|
||||
try {
|
||||
if (!articleLinks) return
|
||||
await navigator.clipboard.writeText(articleLinks.borisUrl)
|
||||
} catch (e) {
|
||||
console.warn('Copy failed', e)
|
||||
} finally {
|
||||
setShowArticleMenu(false)
|
||||
}
|
||||
}
|
||||
|
||||
const handleCopyOriginal = async () => {
|
||||
try {
|
||||
if (!articleLinks?.sourceUrl) return
|
||||
await navigator.clipboard.writeText(articleLinks.sourceUrl)
|
||||
} catch (e) {
|
||||
console.warn('Copy failed', e)
|
||||
} finally {
|
||||
setShowArticleMenu(false)
|
||||
}
|
||||
}
|
||||
|
||||
// Video actions
|
||||
const handleOpenVideoExternal = () => {
|
||||
if (selectedUrl) window.open(selectedUrl, '_blank', 'noopener,noreferrer')
|
||||
@@ -684,6 +706,22 @@ const ContentPanel: React.FC<ContentPanelProps> = ({
|
||||
<span>Share Original</span>
|
||||
</button>
|
||||
)}
|
||||
<button
|
||||
className="article-menu-item"
|
||||
onClick={handleCopyBoris}
|
||||
>
|
||||
<FontAwesomeIcon icon={faCopy} />
|
||||
<span>Copy Link</span>
|
||||
</button>
|
||||
{articleLinks.sourceUrl && (
|
||||
<button
|
||||
className="article-menu-item"
|
||||
onClick={handleCopyOriginal}
|
||||
>
|
||||
<FontAwesomeIcon icon={faCopy} />
|
||||
<span>Copy Original</span>
|
||||
</button>
|
||||
)}
|
||||
<button
|
||||
className="article-menu-item"
|
||||
onClick={handleOpenPortal}
|
||||
|
||||
Reference in New Issue
Block a user