Skip to content

Commit

Permalink
fix: remove tokens external links for widget
Browse files Browse the repository at this point in the history
  • Loading branch information
siandreev committed Dec 13, 2024
1 parent 2a6888f commit f88fb57
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
WalletSwapAsset
} from '../../../state/swap/useSwapAssets';
import { formatFiatCurrency } from '../../../hooks/balance';
import { useAppContext } from '../../../hooks/appContext';
import { useAppContext, useAppPlatform } from '../../../hooks/appContext';
import { isTon, TonAsset } from '@tonkeeper/core/dist/entries/crypto/asset/ton-asset';
import { LinkOutIcon, SpinnerIcon } from '../../Icon';
import { ConfirmImportNotification } from './ConfirmImportNotification';
Expand Down Expand Up @@ -203,6 +203,7 @@ const TokenListItem: FC<{ swapAsset: WalletSwapAsset; onClick: () => void }> = (
}) => {
const isZeroBalance = swapAsset.assetAmount.relativeAmount.isZero();
const { fiat } = useAppContext();
const platform = useAppPlatform();

let explorerUrl;
if (isTon(swapAsset.assetAmount.asset.address)) {
Expand All @@ -223,9 +224,13 @@ const TokenListItem: FC<{ swapAsset: WalletSwapAsset; onClick: () => void }> = (
<TokenInfo>
<TokenInfoLine>
<Label2>{swapAsset.assetAmount.asset.symbol}</Label2>
<LinkOutIconWrapper href={explorerUrl} onClick={onClickExplorer}>
<LinkOutIcon />
</LinkOutIconWrapper>
{platform === 'swap-widget-web' ? (
<div />
) : (
<LinkOutIconWrapper href={explorerUrl} onClick={onClickExplorer}>
<LinkOutIcon />
</LinkOutIconWrapper>
)}
<BalanceLabel isZero={isZeroBalance}>
{swapAsset.assetAmount.stringRelativeAmount}
</BalanceLabel>
Expand Down

0 comments on commit f88fb57

Please sign in to comment.