Skip to content

Commit

Permalink
Fix referrer link
Browse files Browse the repository at this point in the history
  • Loading branch information
Aliona-D committed Dec 11, 2024
1 parent 5414b38 commit 61cb6f9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/pages/Referrals/AliasSubmit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -24,6 +25,7 @@ type AliasSubmitProps = {
const AliasSubmit: React.FC<AliasSubmitProps> = ({ alias }) => {
const { address: affiliateAddress } = useAccount();
const { signTypedDataAsync } = useSignTypedData();
const location = useLocation();

const [aliasValue, setAliasValue] = useState("");
const [errorMessage, setErrorMessage] = useState<string | null>(null);
Expand Down Expand Up @@ -179,7 +181,9 @@ const AliasSubmit: React.FC<AliasSubmitProps> = ({ alias }) => {

const handleCopyLink = () => {
navigator.clipboard.writeText(
`${window.location.href}?referrer=${registeredAlias?.toLowerCase()}`
`${window.location.origin}${
location.pathname
}?referrer=${registeredAlias?.toLowerCase()}`
);
showToast();
};
Expand Down

0 comments on commit 61cb6f9

Please sign in to comment.