Skip to content

Commit

Permalink
fix: tokens icons fix, limit price message (#11168)
Browse files Browse the repository at this point in the history
<!--
Before opening a pull request, please read the [contributing
guidelines](https://github.com/pancakeswap/pancake-frontend/blob/develop/CONTRIBUTING.md)
first
-->

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on updating dependencies in the `package.json`,
modifying the `Twap.tsx` component to include a new `CurrencyLogo`
feature, and making various adjustments in the `pnpm-lock.yaml` file to
reflect these changes.

### Detailed summary
- Updated versions of `@orbs-network/twap-ui` and
`@orbs-network/twap-ui-pancake` from `0.11.27` to `0.11.31`.
- Added `CurrencyLogo` to the `TWAPPanel` in `Twap.tsx`.
- Introduced a new `TokenLogo` component to handle currency logos.
- Adjusted dependency versions and resolutions in `pnpm-lock.yaml`.

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
  • Loading branch information
denis-orbs authored Feb 5, 2025
1 parent ddc431c commit d69432f
Show file tree
Hide file tree
Showing 3 changed files with 122 additions and 82 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.31",
"@orbs-network/twap-ui-pancake": "0.11.31",
"@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 d69432f

Please sign in to comment.