Skip to content

Commit

Permalink
fix: ton swap details deopdown UI (#11208)
Browse files Browse the repository at this point in the history
<!-- start pr-codex -->

## PR-Codex overview
This PR focuses on refactoring the `AdvancedSwapDetailsDropdown`
component to use a named export and updating the imports in `SwapForm`.
Additionally, it modifies the styling of the `AdvancedDetailsFooter`
component.

### Detailed summary
- Changed `AdvancedSwapDetailsDropdown` from default export to named
export.
- Updated import statement for `AdvancedSwapDetailsDropdown` in
`SwapForm`.
- Added import for `PricingAndSlippage` in `SwapForm`.
- Removed unused import of `formatAmount` in `SwapForm`.
- Adjusted CSS for `AdvancedDetailsFooter` in
`AdvancedSwapDetailsDropdown`.

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

<!-- end pr-codex -->
  • Loading branch information
chef-eric authored Feb 14, 2025
1 parent cf4580d commit c424b95
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
7 changes: 1 addition & 6 deletions apps/ton/src/views/TONSwap/AdvancedSwapDetailsDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,12 @@ import { AdvancedSwapDetails, AdvancedSwapDetailsProps } from './AdvancedSwapDet

const AdvancedDetailsFooter = styled.div<{ show: boolean }>`
margin-top: ${({ show }) => (show ? '16px' : 0)};
padding-top: 16px;
padding-bottom: 16px;
width: 100%;
border-radius: 20px;
background-color: ${({ theme }) => theme.colors.invertedContrast};
transform: ${({ show }) => (show ? 'translateY(0%)' : 'translateY(-100%)')};
transition: transform 300ms ease-in-out;
`

export default function AdvancedSwapDetailsDropdown({ trade, ...rest }: AdvancedSwapDetailsProps) {
export const AdvancedSwapDetailsDropdown = ({ trade, ...rest }: AdvancedSwapDetailsProps) => {
const lastTrade = usePreviousValue(trade)

return (
Expand Down
6 changes: 3 additions & 3 deletions apps/ton/src/views/TONSwap/SwapForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ import { independentFieldAtom, inputCurrencyAtom, outputCurrencyAtom, typedValue
import { TransactionActionType } from 'components/Modals/ActionModal'
import { SwapCommitButton } from 'components/TonSwap/SwapCommitButton'
import { SwapUIV2 } from 'components/widgets/swap-v2'
import { PricingAndSlippage } from 'components/TonSwap/PricingAndSlippage'
import { useSwapActionHandlers } from 'hooks/swap/useSwapActionHandlers'
import { useAtomValue, useSetAtom } from 'jotai'
import { balanceAtom } from 'ton/logic/balanceAtom'
import { Field } from 'types'
import { Rounding, _10000 } from '@pancakeswap/swap-sdk-core'
import { formatAmount, formatFraction } from '@pancakeswap/utils/formatFractions'
import { formatFraction } from '@pancakeswap/utils/formatFractions'
import { tryParseAmount } from 'utils/tryParseAmount'
import { useSwap } from 'ton/logic/swap/useSwap'
import { RefreshButton } from '@pancakeswap/widgets-internal'
import { useBestTrade } from 'hooks/swap/useBestTrade'
import { PricingAndSlippage } from 'components/TonSwap/PricingAndSlippage'
import AdvancedSwapDetailsDropdown from './AdvancedSwapDetailsDropdown'
import { AdvancedSwapDetailsDropdown } from './AdvancedSwapDetailsDropdown'

export const SwapForm = () => {
const { t } = useTranslation()
Expand Down

0 comments on commit c424b95

Please sign in to comment.