Skip to content

Commit

Permalink
tokens icons fix and optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
denis-orbs committed Feb 4, 2025
1 parent ddc431c commit 9505c89
Show file tree
Hide file tree
Showing 3 changed files with 157 additions and 64 deletions.
4 changes: 2 additions & 2 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
"@gnosis.pm/safe-apps-wagmi": "^1.2.0",
"@kyberswap/pancake-liquidity-widgets": "1.0.6",
"@next/bundle-analyzer": "13.0.7",
"@orbs-network/twap-ui": "0.11.27",
"@orbs-network/twap-ui-pancake": "0.11.27",
"@orbs-network/twap-ui": "0.11.30",
"@orbs-network/twap-ui-pancake": "0.11.30",
"@pancakeswap/achievements": "workspace:*",
"@pancakeswap/blog": "workspace:*",
"@pancakeswap/canonical-bridge": "workspace:*",
Expand Down
12 changes: 11 additions & 1 deletion apps/web/src/views/Swap/Twap/Twap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Currency, CurrencyAmount, TradeType } from '@pancakeswap/swap-sdk-core'
import { AutoColumn, Button, useMatchBreakpoints, useModal, useToast, useTooltip } from '@pancakeswap/uikit'
import replaceBrowserHistoryMultiple from '@pancakeswap/utils/replaceBrowserHistoryMultiple'
import { useUserSingleHopOnly } from '@pancakeswap/utils/user'
import { NumericalInput, SwapUIV2 } from '@pancakeswap/widgets-internal'
import { CurrencyLogo, NumericalInput, SwapUIV2 } from '@pancakeswap/widgets-internal'
import ConnectWalletButton from 'components/ConnectWalletButton'
import { AutoRow } from 'components/Layout/Row'
import CurrencySearchModal from 'components/SearchModal/CurrencySearchModal'
Expand Down Expand Up @@ -201,10 +201,20 @@ export function TWAPPanel({ limit }: { limit?: boolean }) {
toast={toast}
FlipButton={FlipButton}
Input={Input}
CurrencyLogo={TokenLogo}
/>
)
}

const TokenLogo = ({ address, size }: { address?: string; size?: string }) => {
const currency = useCurrency(address)

if (!currency) {
return null
}
return <CurrencyLogo currency={currency} size={size} />
}

const switchAnimation = keyframes`
from {transform: rotate(0deg);}
to {transform: rotate(180deg);}
Expand Down
Loading

0 comments on commit 9505c89

Please sign in to comment.