diff --git a/src/components/ContentPanel.tsx b/src/components/ContentPanel.tsx index 2f5aecfc..c218312e 100644 --- a/src/components/ContentPanel.tsx +++ b/src/components/ContentPanel.tsx @@ -380,10 +380,16 @@ const ContentPanel: React.FC = ({ const handleShareExternalUrl = async () => { try { - if (selectedUrl && (navigator as { share?: (d: { title?: string; url?: string }) => Promise }).share) { - await (navigator as { share: (d: { title?: string; url?: string }) => Promise }).share({ title: title || 'Article', url: selectedUrl }) - } else if (selectedUrl) { - await navigator.clipboard.writeText(selectedUrl) + if (!selectedUrl) return + const borisUrl = `${window.location.origin}/r/${encodeURIComponent(selectedUrl)}` + + if ((navigator as { share?: (d: { title?: string; url?: string }) => Promise }).share) { + await (navigator as { share: (d: { title?: string; url?: string }) => Promise }).share({ + title: title || 'Article', + url: borisUrl + }) + } else { + await navigator.clipboard.writeText(borisUrl) } } catch (e) { console.warn('Share failed', e) @@ -391,6 +397,14 @@ const ContentPanel: React.FC = ({ setShowExternalMenu(false) } } + + const handleSearchExternalUrl = () => { + if (selectedUrl) { + const searchUrl = `https://ants.sh/?q=${encodeURIComponent(selectedUrl)}` + window.open(searchUrl, '_blank', 'noopener,noreferrer') + } + setShowExternalMenu(false) + } // Check if article is already marked as read when URL/article changes useEffect(() => { @@ -658,10 +672,10 @@ const ContentPanel: React.FC = ({
+
)}