diff options
Diffstat (limited to 'ui/lib/components/Invite.svelte')
| -rw-r--r-- | ui/lib/components/Invite.svelte | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/ui/lib/components/Invite.svelte b/ui/lib/components/Invite.svelte index 937c911..29631f4 100644 --- a/ui/lib/components/Invite.svelte +++ b/ui/lib/components/Invite.svelte @@ -1,9 +1,13 @@ <script> - import { clipboard } from '@skeletonlabs/skeleton'; + import { copy } from 'svelte-copy'; let { id } = $props(); let inviteUrl = $derived(new URL(`/invite/${id}`, document.location)); + // Nota bene: we cannot use:copy={inviteUrl}, because inviteUrl is not a + // string, and therefore will get treated as an options object. So we must + // explicitly build an options object, containing the value that will + // eventually be interpreted as a string. </script> -<button class="btn bg-secondary-500" use:clipboard={inviteUrl}>copy</button> -<span data-clipboard="inviteUrl">{inviteUrl}</span> +<button use:copy={{ text: inviteUrl }}>copy</button> +<span class="invite-url-literal">{inviteUrl}</span> |
