[]>(
@@ -19,6 +26,9 @@ export default function useAssetTableColumns() {
id: 'symbol',
cell: ({ row }) => {
const asset = getAssetByDenom(row.original.asset.denom) as Asset
+ const market = row.original.market
+ const borrowAsset = row.original.asset as BorrowAsset
+ const showRate = !borrowAsset?.borrowRate
return (
@@ -27,7 +37,18 @@ export default function useAssetTableColumns() {
{asset.symbol}
- {asset.name}
+ {showRate && market ? (
+
+ ) : (
+ {asset.name}
+ )}
)
@@ -37,8 +58,7 @@ export default function useAssetTableColumns() {
id: 'details',
header: (data) => {
const tableData = data.table.options.data as AssetTableRow[]
- const assetData = tableData.length && (tableData[0].asset as BorrowAsset)
- if (assetData && assetData?.borrowRate) return 'Borrow Rate'
+ if (showBorrowRate(tableData)) return 'Borrow Rate'
return 'Balance'
},
cell: ({ row }) => {
diff --git a/src/components/Modals/BorrowModal.tsx b/src/components/Modals/BorrowModal.tsx
index d7aba172..0b2d1714 100644
--- a/src/components/Modals/BorrowModal.tsx
+++ b/src/components/Modals/BorrowModal.tsx
@@ -2,7 +2,7 @@ import BigNumber from 'bignumber.js'
import { useCallback, useEffect, useMemo, useState } from 'react'
import AccountSummary from 'components/Account/AccountSummary'
-import AssetImage from 'components/AssetImage'
+import AssetImage from 'components/Asset/AssetImage'
import Button from 'components/Button'
import Card from 'components/Card'
import DisplayCurrency from 'components/DisplayCurrency'
diff --git a/src/components/Modals/Settings/index.tsx b/src/components/Modals/Settings/index.tsx
index 5cc5670d..9210259a 100644
--- a/src/components/Modals/Settings/index.tsx
+++ b/src/components/Modals/Settings/index.tsx
@@ -1,7 +1,7 @@
import classNames from 'classnames'
import { useCallback, useMemo, useState } from 'react'
-import AssetImage from 'components/AssetImage'
+import AssetImage from 'components/Asset/AssetImage'
import Button from 'components/Button'
import { ArrowCircle, Enter } from 'components/Icons'
import Modal from 'components/Modal'
diff --git a/src/components/Modals/WalletAssets/index.tsx b/src/components/Modals/WalletAssets/index.tsx
index 07ed32d0..ec805db7 100644
--- a/src/components/Modals/WalletAssets/index.tsx
+++ b/src/components/Modals/WalletAssets/index.tsx
@@ -24,6 +24,7 @@ export default function WalletAssetsModal() {
onClose={onClose}
modalClassName='max-w-modal-xs'
headerClassName='bg-white/10 border-b-white/5 border-b items-center p-4'
+ dialogId='wallet-assets-modal'
>
diff --git a/src/components/RewardsCenter.tsx b/src/components/RewardsCenter.tsx
index af2e3422..bb063a1b 100644
--- a/src/components/RewardsCenter.tsx
+++ b/src/components/RewardsCenter.tsx
@@ -1,6 +1,6 @@
import { useCallback, useEffect, useMemo, useState } from 'react'
-import AssetBalanceRow from 'components/AssetBalanceRow'
+import AssetBalanceRow from 'components/Asset/AssetBalanceRow'
import Button from 'components/Button'
import DisplayCurrency from 'components/DisplayCurrency'
import Divider from 'components/Divider'
@@ -10,6 +10,7 @@ import Text from 'components/Text'
import { ASSETS } from 'constants/assets'
import { DEFAULT_SETTINGS } from 'constants/defaultSettings'
import { DISPLAY_CURRENCY_KEY } from 'constants/localStore'
+import { ORACLE_DENOM } from 'constants/oracle'
import useCurrentAccount from 'hooks/useCurrentAccount'
import useLocalStorage from 'hooks/useLocalStorage'
import usePrices from 'hooks/usePrices'
@@ -20,7 +21,6 @@ import { BNCoin } from 'types/classes/BNCoin'
import { byDenom } from 'utils/array'
import { defaultFee } from 'utils/constants'
import { formatAmountWithSymbol, getCoinValue } from 'utils/formatters'
-import { ORACLE_DENOM } from 'constants/oracle'
const renderIncentives = (unclaimedRewards: BNCoin[]) => {
if (unclaimedRewards.length === 0)
@@ -48,10 +48,6 @@ export default function RewardsCenter() {
const [isConfirming, setIsConfirming] = useState(false)
const [estimatedFee, setEstimatedFee] = useState(defaultFee)
const [showRewardsCenter, setShowRewardsCenter] = useToggle()
- const [displayCurrency] = useLocalStorage(
- DISPLAY_CURRENCY_KEY,
- DEFAULT_SETTINGS.displayCurrency,
- )
const claimRewards = useStore((s) => s.claimRewards)
const { data: prices } = usePrices()
const { data: unclaimedRewards } = useUnclaimedRewards()
diff --git a/src/components/Select/Option.tsx b/src/components/Select/Option.tsx
index 1fde17c7..b70983c8 100644
--- a/src/components/Select/Option.tsx
+++ b/src/components/Select/Option.tsx
@@ -1,6 +1,6 @@
import classNames from 'classnames'
-import AssetImage from 'components/AssetImage'
+import AssetImage from 'components/Asset/AssetImage'
import DisplayCurrency from 'components/DisplayCurrency'
import { ChevronDown, ChevronRight } from 'components/Icons'
import Text from 'components/Text'
diff --git a/src/components/TokenInput/index.tsx b/src/components/TokenInput/index.tsx
index 27697718..4194b8b5 100644
--- a/src/components/TokenInput/index.tsx
+++ b/src/components/TokenInput/index.tsx
@@ -1,7 +1,7 @@
import BigNumber from 'bignumber.js'
import classNames from 'classnames'
-import AssetImage from 'components/AssetImage'
+import AssetImage from 'components/Asset/AssetImage'
import Button from 'components/Button'
import DisplayCurrency from 'components/DisplayCurrency'
import { FormattedNumber } from 'components/FormattedNumber'
diff --git a/src/components/Tooltip/index.tsx b/src/components/Tooltip/index.tsx
index 1c27dc7b..38d2c552 100644
--- a/src/components/Tooltip/index.tsx
+++ b/src/components/Tooltip/index.tsx
@@ -23,9 +23,12 @@ export type TooltipType = 'info' | 'warning' | 'error'
export const Tooltip = (props: Props) => {
const [reduceMotion] = useLocalStorage(REDUCE_MOTION_KEY, DEFAULT_SETTINGS.reduceMotion)
+ const isInWalletAssetModal = document.getElementById('wallet-assets-modal')
+ const isInModal = document.getElementById('modal')
+
return (
document.querySelector('dialog[open]') ?? document.body}
+ appendTo={() => isInWalletAssetModal ?? isInModal ?? document.body}
interactive={props.interactive}
animation={false}
delay={[props.delay ?? 0, 0]}
diff --git a/src/components/Trade/TradeModule/AssetSelector/AssetButton.tsx b/src/components/Trade/TradeModule/AssetSelector/AssetButton.tsx
index 355e5adc..9ed9adbf 100644
--- a/src/components/Trade/TradeModule/AssetSelector/AssetButton.tsx
+++ b/src/components/Trade/TradeModule/AssetSelector/AssetButton.tsx
@@ -1,4 +1,4 @@
-import AssetImage from 'components/AssetImage'
+import AssetImage from 'components/Asset/AssetImage'
import Button from 'components/Button'
interface Props {
diff --git a/src/components/Trade/TradeModule/AssetSelector/AssetItem.tsx b/src/components/Trade/TradeModule/AssetSelector/AssetItem.tsx
index 121538e1..2947bf29 100644
--- a/src/components/Trade/TradeModule/AssetSelector/AssetItem.tsx
+++ b/src/components/Trade/TradeModule/AssetSelector/AssetItem.tsx
@@ -1,4 +1,4 @@
-import AssetImage from 'components/AssetImage'
+import AssetImage from 'components/Asset/AssetImage'
import DisplayCurrency from 'components/DisplayCurrency'
import { StarFilled, StarOutlined } from 'components/Icons'
import Text from 'components/Text'
diff --git a/src/types/interfaces/components/Modals/AssetSelect.d.ts b/src/types/interfaces/components/Modals/AssetSelect.d.ts
index 3770c1db..e9715164 100644
--- a/src/types/interfaces/components/Modals/AssetSelect.d.ts
+++ b/src/types/interfaces/components/Modals/AssetSelect.d.ts
@@ -1,4 +1,5 @@
interface AssetTableRow {
balance?: string
asset: BorrowAsset | Asset
+ market?: Market
}
|