Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.49] Don't display "Approve" button in tokens list for native token #3344

Closed
shoom3301 opened this issue Nov 7, 2023 · 2 comments
Closed
Labels
Bug Something isn't working Trivial Issues with trivial priority

Comments

@shoom3301
Copy link
Collaborator

Description

image

How to Reproduce
Steps to reproduce the behavior:

  1. Go to '/account/tokens'

Expected behavior
"Approve" button is not disabled for native token

@shoom3301 shoom3301 changed the title Don't display "Approve" button in tokens list for native token [1.49] Don't display "Approve" button in tokens list for native token Nov 7, 2023
@shoom3301 shoom3301 added the Trivial Issues with trivial priority label Nov 7, 2023
@t0rbik
Copy link

t0rbik commented Nov 21, 2023

Was looking at this and wonder if nativeAndWrappedTokens.ts should actually pass isNative set to true to TokenWithLogo constructor?
Then in TokensTableRow.txs you could just:

const displayApproveContent = useMemo(() => {
    if (tokenData.isNative) {
      return null;
    }
...

Other option is to do similar to some other places:

...
const isNative = getIsNativeToken(tokenData)

  const displayApproveContent = useMemo(() => {
    if (isNative) {
      return null
    }
...

and then for etherscan link:

...
<Cell>
        {!isNative &&
          <ExtLink href={getBlockExplorerUrl(chainId, 'token', tokenData.address)}>
            <TableButton>
              <SVG src={EtherscanImage} title="View token contract" description="View token contract" />
            </TableButton>
          </ExtLink>}
        {displayApproveContent}
</Cell>
...

In any case lmk if you want a PR as this Trivial indeed.

@elena-zh elena-zh added the Bug Something isn't working label Nov 23, 2023
@elena-zh
Copy link
Contributor

Fixed in #3786

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Trivial Issues with trivial priority
Projects
None yet
Development

No branches or pull requests

3 participants