Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
denis-orbs committed Feb 27, 2024
1 parent cab0ff4 commit efedf7f
Show file tree
Hide file tree
Showing 11 changed files with 263 additions and 343 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@ethersproject/experimental": "^5.7.0",
"@gelatonetwork/relay-sdk": "^5.5.2",
"@marcius-capital/binance-api": "^0.2.16",
"@orbs-network/liquidity-hub-widget": "0.0.204",
"@orbs-network/liquidity-hub-widget": "0.0.217",
"@rainbow-me/rainbowkit": "^1.0.8",
"@react-spring/web": "^9.3.0",
"@reduxjs/toolkit": "^1.9.7",
Expand Down
File renamed without changes.
6 changes: 4 additions & 2 deletions src/components/App/SpotTrading/SpotTradeDetails/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useFromTokenPanel, useTransactionEstimateGas } from '@orbs-network/liquidity-hub-widget'
import { useFormatNumber, useFromTokenPanel, usePriceUsd, useTransactionEstimateGasPrice, zeroAddress } from '@orbs-network/liquidity-hub-widget'
import CollapseChevron from 'components/CollapseChevron'

import { Info as InfoIcon } from 'components/Icons'
Expand Down Expand Up @@ -82,7 +82,9 @@ export default function SpotTradeDetails({}: {}) {
const [isCollapsed, setIsCollapsed] = useState<boolean>(false)
const { token, amount } = useFromTokenPanel()

const txFee = useTransactionEstimateGas()
const { data: usd } = usePriceUsd({ address: zeroAddress })

const txFee = useFormatNumber({ value: useTransactionEstimateGasPrice(usd) })

return (
<Wrapper>
Expand Down
8 changes: 4 additions & 4 deletions src/components/App/SpotTrading/SpotTradeInput/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { Token } from '@orbs-network/liquidity-hub-widget'
import { Token, useFormatNumber, useUsdAmount } from '@orbs-network/liquidity-hub-widget'
import TokenDropdown from 'components/App/SpotTrading/TokenDropdown'
import BalanceWallet from 'components/BalanceWallet'
import LineChartBaseline from 'components/Icons/LineChartBaseline'
import { SpotCustomBox } from 'components/InputBox'
import TokenSelectionModal from 'components/Modals/SpotTrading/TokenSelectionModal'
import { Row } from 'components/Row'
import { useUsdAmount } from 'hooks/useSpotTrading'
import { useIsLaptop, useIsMobile } from 'lib/hooks/useWindowSize'
import { useCallback, useState } from 'react'
import styled from 'styled-components'
Expand Down Expand Up @@ -64,7 +63,8 @@ export default function SpotTradeInput({
const [isOpen, setIsOpen] = useState(false)
const isMobile = useIsMobile()
const isLaptop = useIsLaptop()
const usd = useUsdAmount(token?.address, value || '0')
const usd = useUsdAmount(token?.address, value || '0').usd
const _balance = useFormatNumber({ value: balance })

const _onTokenSelect = useCallback(
(token: Token) => {
Expand All @@ -82,7 +82,7 @@ export default function SpotTradeInput({
<TokenDropdown token={token} onClick={() => setIsOpen(true)} />
<Row gap="4px">
<BalanceWallet />
<Label>Balance: {balance || '0.00'}</Label>
<Label>Balance: {_balance || '0.00'}</Label>
</Row>
</ColumnContainer>

Expand Down
Loading

0 comments on commit efedf7f

Please sign in to comment.