mirror of
https://github.com/lukevella/rallly.git
synced 2025-08-06 09:59:00 +02:00
🐛 Show short url in invite dialog (#995)
This commit is contained in:
parent
0384b5a33a
commit
040f223d00
1 changed files with 2 additions and 1 deletions
|
@ -20,6 +20,7 @@ export function CopyInviteLinkButton() {
|
||||||
const [didCopy, setDidCopy] = React.useState(false);
|
const [didCopy, setDidCopy] = React.useState(false);
|
||||||
const [state, copyToClipboard] = useCopyToClipboard();
|
const [state, copyToClipboard] = useCopyToClipboard();
|
||||||
const poll = usePoll();
|
const poll = usePoll();
|
||||||
|
const inviteLinkWithoutProtocol = poll.inviteLink.replace(/^https?:\/\//, "");
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
if (state.error) {
|
if (state.error) {
|
||||||
|
@ -41,7 +42,7 @@ export function CopyInviteLinkButton() {
|
||||||
{didCopy ? (
|
{didCopy ? (
|
||||||
<Trans i18nKey="copied" />
|
<Trans i18nKey="copied" />
|
||||||
) : (
|
) : (
|
||||||
<span className="min-w-0 truncate">{`${window.location.hostname}/invite/${poll.id}`}</span>
|
<span className="min-w-0 truncate">{inviteLinkWithoutProtocol}</span>
|
||||||
)}
|
)}
|
||||||
</Button>
|
</Button>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue