mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-06 00:27:24 +00:00
Copy the full giftcard URL in the credits dialog
This commit is contained in:
1 file changed
+8
-1
@@ -554,7 +554,14 @@ export function CreditsDialog({ open, onOpenChange, provider }: CreditsDialogPro
|
||||
};
|
||||
|
||||
const handleCopyCode = (code: string) => {
|
||||
navigator.clipboard.writeText(code);
|
||||
// Create the full shareable URL for the gift card
|
||||
const url = new URL('/giftcard', window.location.origin);
|
||||
url.hash = new URLSearchParams({
|
||||
baseURL: provider.baseURL,
|
||||
code: code,
|
||||
}).toString();
|
||||
|
||||
navigator.clipboard.writeText(url.toString());
|
||||
setCopiedCode(code);
|
||||
setTimeout(() => setCopiedCode(null), 2000);
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user