diff --git a/src/components/app/affiliate/AppAffiliate.tsx b/src/components/app/affiliate/AppAffiliate.tsx index 86f68d96..b542799a 100644 --- a/src/components/app/affiliate/AppAffiliate.tsx +++ b/src/components/app/affiliate/AppAffiliate.tsx @@ -1,5 +1,17 @@ -import { Button, Card, Input } from "@/components/ui"; -import { createAffiliateCode, RequestParams } from "@/services/api/createAffiliateCode"; +import { + Button, + Card, + DialogTrigger, + Input, + Tooltip, + TooltipContent, + TooltipTrigger, +} from "@/components/ui"; +import { + AffiliateResponse, + createAffiliateCode, + RequestParams, +} from "@/services/api/createAffiliateCode"; import { FC, useEffect, useRef, useState } from "react"; import { twMerge } from "tailwind-merge"; import { useCopyToClipboard } from "usehooks-ts"; @@ -10,6 +22,9 @@ export const AppAffiliate: FC = () => { const [isLoading, setIsLoading] = useState(false); const [copiedText, copy] = useCopyToClipboard(); const [affiliateUrl, setAffiliateUrl] = useState("https://ledgity.finance/example"); + const [errorMsg, setErrorMsg] = useState(); + const [isError, setIsError] = useState(false); + const [affiliateData, setAffiliateData] = useState(); const handleCopy = (text: string) => { copy(text) @@ -28,7 +43,10 @@ export const AppAffiliate: FC = () => { walletAddress: getAddress(walletAddress), }; const data = await createAffiliateCode(requestParams); - console.log("data: ", data); + // setIsError(!data.isSuccess); + // setErrorMsg(data.message); + // setErrorMsg(data.message); + setAffiliateData(data); setIsLoading(false); } }; @@ -51,13 +69,25 @@ export const AppAffiliate: FC = () => { >
Paste your wallet to participate in the affiliate program!
- (setWalletAddress ? setWalletAddress(e.target.value) : null)} - disableDefaultCss={true} - className="bg-gray-300 w-full p-1 rounded-lg text-sm" - /> + + + (setWalletAddress ? setWalletAddress(e.target.value) : null)} + disableDefaultCss={true} + className="bg-gray-300 w-full p-2 rounded-lg text-sm" + /> + + + {affiliateData?.message} + +