Skip to content

Commit

Permalink
Merge pull request #875 from invariant-labs/fix-custom-token-name
Browse files Browse the repository at this point in the history
fix unknown token name on popular pools
  • Loading branch information
wojciech-cichocki authored Jan 31, 2025
2 parents 7138372 + 5629415 commit 37e3a92
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/PopularPools/Card/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import cardBackgroundBottom from '@static/png/cardBackground1.png'
import cardBackgroundTop from '@static/png/cardBackground2.png'
import icons from '@static/icons'
import RevertIcon from '@static/svg/revert.svg'
import { shortenAddress } from '@utils/uiUtils'
import StatsLabel from './StatsLabel/StatsLabel'
import backIcon from '@static/svg/back-arrow-2.svg'
import { addressToTicker, formatNumber, initialXtoY, parseFeeToPathFee } from '@utils/utils'
Expand Down Expand Up @@ -66,6 +65,9 @@ const Card: React.FC<ICard> = ({
)
}

const shortenAddressName = (address: string) =>
address.length > 8 ? `${address.slice(0, 4)}...` : address

return (
<Grid className={classes.root}>
{isLoading ? (
Expand Down Expand Up @@ -123,7 +125,7 @@ const Card: React.FC<ICard> = ({
</Grid>

<Typography className={classes.symbolsContainer}>
{shortenAddress(symbolFrom ?? '')} - {shortenAddress(symbolTo ?? '')}
{shortenAddressName(symbolFrom ?? '')} - {shortenAddressName(symbolTo ?? '')}
</Typography>
<Grid container gap='8px'>
{apy !== undefined && showAPY && (
Expand Down

0 comments on commit 37e3a92

Please sign in to comment.