tangled
alpha
login
or
join now
leaflet.pub
/
leaflet
289
fork
atom
a tool for shared writing and social publishing
289
fork
atom
overview
issues
28
pulls
pipelines
write invite link to clipboard
cozylittle.house
3 months ago
a31d9ba1
252c1f2d
+21
-14
1 changed file
expand all
collapse all
unified
split
app
lish
[did]
[publication]
dashboard
publicationSettings
PublicationContributors.tsx
+21
-14
app/lish/[did]/[publication]/dashboard/publicationSettings/PublicationContributors.tsx
···
9
9
import { ButtonPrimary } from "components/Buttons";
10
10
import { PopoverArrow } from "components/Icons/PopoverArrow";
11
11
import { useSmoker } from "components/Toast";
12
12
+
import { usePublicationData } from "../PublicationSWRProvider";
13
13
+
import { getPublicationURL } from "app/lish/createPub/getPublicationURL";
12
14
13
15
export const PubContributorManager = (props: {
14
16
backToMenuAction: () => void;
···
55
57
contributors: { name: string; status: string }[];
56
58
}) => {
57
59
let [inputValue, setInputValue] = useState("");
60
60
+
let smoker = useSmoker();
61
61
+
let { data: pub } = usePublicationData();
62
62
+
63
63
+
function getContributorLink(e: React.MouseEvent) {
64
64
+
let pubUrl = getPublicationURL(pub?.publication!);
65
65
+
navigator.clipboard.writeText(`${pubUrl}/invite-contributor`);
66
66
+
67
67
+
smoker({
68
68
+
text: "Copied Invite Link!",
69
69
+
position: {
70
70
+
y: e.clientY,
71
71
+
x: e.clientX,
72
72
+
},
73
73
+
});
74
74
+
}
75
75
+
58
76
return (
59
77
<div className="flex flex-col gap-1 pt-2">
60
78
<div className="flex flex-col gap-0.5">
···
72
90
</div>
73
91
</div>
74
92
93
93
+
{/*ONLY SHOW ON ADD*/}
75
94
<div className="flex flex-col gap-1 text-sm text-secondary text-center mb-2 mt-1 p-2 accent-container">
76
95
<ButtonPrimary fullWidth compact onClick={(e) => getContributorLink(e)}>
77
96
Copy Accept Invite Link
78
97
</ButtonPrimary>
79
79
-
Send this link to contributors so they can access this publication
98
98
+
Send this link to invited contributors to access this publication
80
99
</div>
81
100
<hr className="border-border-light" />
82
101
···
93
112
className="text-sm text-accent-contrast italic w-max shrink-0"
94
113
onClick={(e) => getContributorLink(e)}
95
114
>
96
96
-
Resend Invite
115
115
+
Copy Invite
97
116
</button>
98
117
)}
99
118
···
105
124
</div>
106
125
);
107
126
};
108
108
-
109
109
-
function getContributorLink(e: React.MouseEvent) {
110
110
-
let smoker = useSmoker();
111
111
-
112
112
-
smoker({
113
113
-
text: "Copied Invite Link!",
114
114
-
position: {
115
115
-
y: e.clientY,
116
116
-
x: e.clientX,
117
117
-
},
118
118
-
});
119
119
-
}
120
127
121
128
const PubContributorOptions = () => {
122
129
return (