Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
…nterface into create-referral-page
…nterface into create-referral-page
…nterface into create-referral-page
src/hooks/useReferralClaim.ts
Outdated
| value: value, | ||
| } | ||
|
|
||
| console.log('tx: ', tx) |
There was a problem hiding this comment.
| console.log('tx: ', tx) |
| call: {address, calldata, value}, | ||
| } = bestCallOption | ||
|
|
||
| console.log('bestCallOption: ', bestCallOption) |
There was a problem hiding this comment.
| console.log('bestCallOption: ', bestCallOption) |
| // let the wallet try if we can't estimate the gas | ||
| ...('gasEstimate' in bestCallOption ? {gasLimit: calculateGasMargin(bestCallOption.gasEstimate)} : {}), | ||
| ...(value && !isZero(value) ? {value} : {}), |
There was a problem hiding this comment.
Why are we estimating the gas ourselves? Isn't this done automatically by ethers?
Note: we seem to be doing that everywhere, not just here.
src/hooks/useReferralCode.ts
Outdated
| value: value, | ||
| } | ||
|
|
||
| console.log('tx: ', tx) |
There was a problem hiding this comment.
| console.log('tx: ', tx) |
| value: value, | ||
| } | ||
|
|
||
| console.log('tx: ', tx) |
There was a problem hiding this comment.
| console.log('tx: ', tx) |
src/pages/Referral/ReferralPage.tsx
Outdated
| <a href="/" style={{color: colors(false).dark.blue2}}> | ||
| Markets | ||
| </a>{' '} |
There was a problem hiding this comment.
I think this link should be using the React router instead of an <a> tag; using this is causing a full refresh of the page.
| <Box className={classes.lightBox}> | ||
| <TEXT.BoldStandardBody>Rebates. Fee discounts.</TEXT.BoldStandardBody> | ||
| <TEXT.StandardBody> | ||
| Need mor info?{' '} |
There was a problem hiding this comment.
| Need mor info?{' '} | |
| Need more info?{' '} |
| <a href="/" style={{color: colors(false).dark.blue2}}> | ||
| Overlay Referral Program →{' '} | ||
| </a> |
There was a problem hiding this comment.
This is not redirecting to the Referral page. Also, it's using <a> instead of React router, so it causes a full refresh of the page.
| <OutlinedInput | ||
| error={validAddress} | ||
| className={classes.referralInput} | ||
| placeholder="Enter referral link" | ||
| onChange={e => setReferralLink(e.target.value)} | ||
| value={referralLink} | ||
| /> | ||
| {/* <Box | ||
| sx={{ | ||
| marginTop: 20, | ||
| display: 'flex', | ||
| flexDirection: 'column', | ||
| alignItems: 'center', | ||
| }} | ||
| > */} | ||
| {!account && <ConnectWalletButton onClick={toggleWalletModal}>Connect wallet</ConnectWalletButton>} | ||
| {account && ( | ||
| <TriggerActionButton onClick={() => handleReferralCodeButton()} className={classes.referralButton}> | ||
| Submit link | ||
| </TriggerActionButton> | ||
| )} |
There was a problem hiding this comment.
- The card says my rewards pending are 0, when they are not (see console).
- The tx fails (that's ok, I'm using an incorrect proof), but I don't have any feedback in the UI, just in the console.
- Even when the tx goes through, I don't get any success message in the UI, just the tx receipt in the console.
After claiming, I now see a negative "rewards pending" in the card, but in the console it shows that my [pending] rewards are 0 (which is correct).
Also, I suggest removing all the console.log used for debugging, only keep the ones that are displayed when there's an error.
| setReferralCodeState({ | ||
| showConfirm: false, | ||
| attemptingTransaction: false, | ||
| transactionErrorMessage: undefined, | ||
| transactionHash: hash, | ||
| }) |
There was a problem hiding this comment.
I think this shouldn't have been deleted, it was the setReferralCodeState above this one the one that was redundant.
src/components/Card/OverviewCard.tsx
Outdated
| </TEXT.Supplemental> | ||
| </Tooltip> | ||
| <div> | ||
| <Tooltip title={tooltip || 'hola'} placement="top"> |
There was a problem hiding this comment.
title={tooltip || 'hola'} looks suspicious
| value={referralLink} | ||
| /> | ||
| {transactionErrorMessage != undefined && !transactionErrorMessage.toString().includes('Transaction rejected') && ( | ||
| <TEXT.Supplemental color={colors(false).dark.red}>Invalid wallet address</TEXT.Supplemental> |
There was a problem hiding this comment.
I believe the error message "Invalid wallet address" is a bit misleading. Would be nice to manage the error better, for instance saying that "the account is neither an affiliate nor an ambassador", or that the user has already specified a referrer before, which are the two types of error that can occur.
Btw, have you added any loading state when the transaction is being processed? Just disabling the "Submit Address" button would be enough.
There was a problem hiding this comment.
Did you add any success or error messages to the claiming rewards flow? I can't see any in the code, and I believe the error messages are very important.



No description provided.