From 6664f0be2bc54f8d6fb72b7df8e8891140b562ec Mon Sep 17 00:00:00 2001 From: lemma <> Date: Sun, 7 Jun 2026 16:07:11 -0500 Subject: [PATCH] Add feed button to publications --- app/routes/profile.tsx | 63 +++++++++++++++++++++++++++++------------- 1 file changed, 44 insertions(+), 19 deletions(-) diff --git a/app/routes/profile.tsx b/app/routes/profile.tsx index c13487f..47ca444 100644 --- a/app/routes/profile.tsx +++ b/app/routes/profile.tsx @@ -12,6 +12,7 @@ import PostList from '~/components/PostList' import CenteredMessage from '~/components/CenteredMessage' import PageLayout from '~/components/PageLayout' import Spinner from '~/components/Spinner' +import { RssIcon } from '@heroicons/react/24/outline' import type { Route } from './+types/profile' import { SITE_NAME } from '~/lib/site-config' @@ -30,6 +31,7 @@ export default function Profile() { // publicationAtUri → subscriptionRkey; undefined = not yet loaded const [subscriptionsByPub, setSubscriptionsByPub] = useState | undefined>(undefined) const [loadingPubs, setLoadingPubs] = useState>({}) + const [copiedPubUri, setCopiedPubUri] = useState(null) useEffect(() => { if (!id) return @@ -127,6 +129,15 @@ export default function Profile() { } } + async function handleCopyFeed(pub: Publication) { + const feedUrl = `${pub.url.replace(/\/$/, '')}/feed.xml` + try { + await navigator.clipboard.writeText(feedUrl) + setCopiedPubUri(pub.atUri) + setTimeout(() => setCopiedPubUri((cur) => (cur === pub.atUri ? null : cur)), 2500) + } catch { /* ignore */ } + } + if (error) { return } @@ -166,26 +177,40 @@ export default function Profile() { {pub.description && (

{pub.description}

)} + {copiedPubUri === pub.atUri && ( +

+ Feed URL copied — paste into your RSS reader +

+ )} + +
+ + {showSubscribeButtons && ( + isSubscribed ? ( + + ) : ( + + ) + )}
- {showSubscribeButtons && ( - isSubscribed ? ( - - ) : ( - - ) - )} ) })} -- 2.51.2