From 61cb6f995130bd9848bdd2411e77b136c10312ff Mon Sep 17 00:00:00 2001 From: Aliona-D Date: Wed, 11 Dec 2024 17:07:55 +0200 Subject: [PATCH] Fix referrer link --- src/pages/Referrals/AliasSubmit.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pages/Referrals/AliasSubmit.tsx b/src/pages/Referrals/AliasSubmit.tsx index 8d59832..340cff2 100644 --- a/src/pages/Referrals/AliasSubmit.tsx +++ b/src/pages/Referrals/AliasSubmit.tsx @@ -16,6 +16,7 @@ import { useAccount, useSignTypedData } from "wagmi"; import { isAddress } from "viem"; import { CopyGradientIcon } from "../../assets/icons/svg-icons"; import { CopyLink, Toast } from "./alias-submit-styles"; +import { useLocation } from "react-router-dom"; type AliasSubmitProps = { alias: string | null; @@ -24,6 +25,7 @@ type AliasSubmitProps = { const AliasSubmit: React.FC = ({ alias }) => { const { address: affiliateAddress } = useAccount(); const { signTypedDataAsync } = useSignTypedData(); + const location = useLocation(); const [aliasValue, setAliasValue] = useState(""); const [errorMessage, setErrorMessage] = useState(null); @@ -179,7 +181,9 @@ const AliasSubmit: React.FC = ({ alias }) => { const handleCopyLink = () => { navigator.clipboard.writeText( - `${window.location.href}?referrer=${registeredAlias?.toLowerCase()}` + `${window.location.origin}${ + location.pathname + }?referrer=${registeredAlias?.toLowerCase()}` ); showToast(); };