Skip to content

Commit 57cb47d

Browse files
Managed the share
1 parent 7b828a1 commit 57cb47d

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

components/CelebrationModal.tsx

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,17 @@ export const CelebrationModal: React.FC<ModalProps> = ({ isOpen, onClose }) => {
1717
}
1818
}, [isOpen]);
1919

20-
const handleShare = async () => {
21-
if (navigator.share) {
22-
try {
23-
await navigator.share({
24-
title: "Tab for a Cause - $2 Million Raised",
25-
text: "We just hit $2 Million raised for charity! Join the movement at tabforacause.org",
26-
url: "https://tab.gladly.io/2-million/",
27-
});
28-
} catch (error) {
29-
console.log("Error sharing:", error);
30-
}
31-
} else {
32-
// Fallback for browsers that don't support Web Share API
33-
alert("Thanks for sharing the news!");
34-
}
20+
const handleShare = () => {
21+
// Tell parent to show the referral iframe
22+
const url = 'https://tab.gladly.io/v5/referral?user_id=woots';
23+
window.parent.postMessage({
24+
show: true,
25+
iframe: url,
26+
height: document.body.scrollHeight,
27+
slot: 'modal-center',
28+
version: 'Version0',
29+
notification: '2m-reached-dec-2025'
30+
}, '*');
3531
};
3632

3733
// Smoother, less "bouncy" entrance for a more professional feel

0 commit comments

Comments
 (0)