Skip to content

Commit

Permalink
fix type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
timolegros committed Dec 19, 2024
1 parent 36d8bd9 commit 89721b0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 51 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { useFlag } from 'hooks/useFlag';
import React from 'react';
import useUserStore from 'state/ui/user';
import { saveToClipboard } from 'utils/clipboard';
import { PopoverMenu } from 'views/components/component_kit/CWPopoverMenu';
import { PopoverTriggerProps } from 'views/components/component_kit/new_designs/CWPopover';
import { CWThreadAction } from 'views/components/component_kit/new_designs/cw_thread_action';
import useReferralLink from '../../modals/InviteLinkModal/useReferralLink';

const TWITTER_SHARE_LINK_PREFIX = 'https://twitter.com/intent/tweet?text=';

Expand All @@ -18,10 +18,9 @@ export const SharePopover = ({
linkToShare,
buttonLabel,
}: SharePopoverProps) => {
const user = useUserStore();
const referralsEnabled = useFlag('referrals');

const { getReferralLink } = useReferralLink();

const defaultRenderTrigger = (
onClick: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void,
) => (
Expand All @@ -38,9 +37,10 @@ export const SharePopover = ({

const handleCopy = async () => {
if (referralsEnabled) {
const referralLink = await getReferralLink();
const refLink =
linkToShare + (referralLink ? `?refcode=${referralLink}` : '');
// TODO: @Marcin to check address access (referral link creation) + related changes in this file
linkToShare +
(user.activeAccount ? `?refcode=${user.activeAccount.address}` : '');
await saveToClipboard(refLink, true);
} else {
await saveToClipboard(linkToShare, true);
Expand Down

This file was deleted.

0 comments on commit 89721b0

Please sign in to comment.