From a31d9ba1112a3be2172ba93b11dccc945c8b2cfe Mon Sep 17 00:00:00 2001 From: celine Date: Mon, 24 Nov 2025 23:58:39 -0500 Subject: [PATCH] write invite link to clipboard --- .../PublicationContributors.tsx | 35 +++++++++++-------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/app/lish/[did]/[publication]/dashboard/publicationSettings/PublicationContributors.tsx b/app/lish/[did]/[publication]/dashboard/publicationSettings/PublicationContributors.tsx index d95060ab..1b9d1bef 100644 --- a/app/lish/[did]/[publication]/dashboard/publicationSettings/PublicationContributors.tsx +++ b/app/lish/[did]/[publication]/dashboard/publicationSettings/PublicationContributors.tsx @@ -9,6 +9,8 @@ import { Input } from "components/Input"; import { ButtonPrimary } from "components/Buttons"; import { PopoverArrow } from "components/Icons/PopoverArrow"; import { useSmoker } from "components/Toast"; +import { usePublicationData } from "../PublicationSWRProvider"; +import { getPublicationURL } from "app/lish/createPub/getPublicationURL"; export const PubContributorManager = (props: { backToMenuAction: () => void; @@ -55,6 +57,22 @@ const PubContributorsContent = (props: { contributors: { name: string; status: string }[]; }) => { let [inputValue, setInputValue] = useState(""); + let smoker = useSmoker(); + let { data: pub } = usePublicationData(); + + function getContributorLink(e: React.MouseEvent) { + let pubUrl = getPublicationURL(pub?.publication!); + navigator.clipboard.writeText(`${pubUrl}/invite-contributor`); + + smoker({ + text: "Copied Invite Link!", + position: { + y: e.clientY, + x: e.clientX, + }, + }); + } + return (
@@ -72,11 +90,12 @@ const PubContributorsContent = (props: {
+ {/*ONLY SHOW ON ADD*/}
getContributorLink(e)}> Copy Accept Invite Link - Send this link to contributors so they can access this publication + Send this link to invited contributors to access this publication

@@ -93,7 +112,7 @@ const PubContributorsContent = (props: { className="text-sm text-accent-contrast italic w-max shrink-0" onClick={(e) => getContributorLink(e)} > - Resend Invite + Copy Invite )} @@ -106,18 +125,6 @@ const PubContributorsContent = (props: { ); }; -function getContributorLink(e: React.MouseEvent) { - let smoker = useSmoker(); - - smoker({ - text: "Copied Invite Link!", - position: { - y: e.clientY, - x: e.clientX, - }, - }); -} - const PubContributorOptions = () => { return ( }> -- 2.51.2