mirror of
https://github.com/dergigi/boris.git
synced 2025-12-19 15:44:20 +01:00
feat: add Copy Link and Copy Original options to article menu
This commit is contained in:
@@ -289,6 +289,28 @@ const ContentPanel: React.FC<ContentPanelProps> = ({
|
|||||||
setShowArticleMenu(false)
|
setShowArticleMenu(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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
|
// Video actions
|
||||||
const handleOpenVideoExternal = () => {
|
const handleOpenVideoExternal = () => {
|
||||||
@@ -684,6 +706,22 @@ const ContentPanel: React.FC<ContentPanelProps> = ({
|
|||||||
<span>Share Original</span>
|
<span>Share Original</span>
|
||||||
</button>
|
</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
|
<button
|
||||||
className="article-menu-item"
|
className="article-menu-item"
|
||||||
onClick={handleOpenPortal}
|
onClick={handleOpenPortal}
|
||||||
|
|||||||
Reference in New Issue
Block a user