+
-
+
-
,
open: true,
},
- { title: 'Balances', content:
My content
},
+ { title: 'Balances', content: },
]}
/>
diff --git a/src/components/DisplayCurrency.tsx b/src/components/DisplayCurrency.tsx
index c56cb3e3..2eef0fe0 100644
--- a/src/components/DisplayCurrency.tsx
+++ b/src/components/DisplayCurrency.tsx
@@ -2,8 +2,7 @@ import { Coin } from '@cosmjs/stargate'
import { FormattedNumber } from 'components/FormattedNumber'
import useStore from 'store'
-import { getMarketAssets } from 'utils/assets'
-import { BN } from 'utils/helpers'
+import { convertToDisplayAmount } from 'utils/formatters'
interface Props {
coin: Coin
@@ -15,24 +14,10 @@ export default function DisplayCurrency(props: Props) {
const displayCurrency = useStore((s) => s.displayCurrency)
const prices = useStore((s) => s.prices)
- function convertToDisplayAmount(coin: Coin) {
- const price = prices.find((price) => price.denom === coin.denom)
- const asset = getMarketAssets().find((asset) => asset.denom === coin.denom)
- const displayPrice = prices.find((price) => price.denom === displayCurrency.denom)
-
- if (!price || !asset || !displayPrice) return '0'
-
- return BN(coin.amount)
- .shiftedBy(-1 * asset.decimals)
- .times(price.amount)
- .div(displayPrice.amount)
- .toNumber()
- }
-
return (
{
- if (!selectedAccount)
- setSelectedAccount(currentAccount)
+ if (!selectedAccount) setSelectedAccount(currentAccount)
}, [selectedAccount, currentAccount])
useEffect(() => {
diff --git a/src/components/Portfolio/AccountOverview.tsx b/src/components/Portfolio/AccountOverview.tsx
index 338d2a00..09525f31 100644
--- a/src/components/Portfolio/AccountOverview.tsx
+++ b/src/components/Portfolio/AccountOverview.tsx
@@ -1,6 +1,7 @@
import classNames from 'classnames'
import { Suspense } from 'react'
+import { AcccountBalancesTable } from 'components/Account/AccountBalancesTable'
import AccountComposition from 'components/Account/AccountComposition'
import Card from 'components/Card'
import Loading from 'components/Loading'
@@ -30,13 +31,10 @@ async function Content(props: PageProps) {
className={classNames('grid w-full grid-cols-1 gap-4', 'md:grid-cols-2', 'lg:grid-cols-3')}
>
{account.map((account: Account, index: number) => (
-
+
+ Balances
+
))}
@@ -50,13 +48,12 @@ function Fallback() {
className={classNames('grid w-full grid-cols-1 gap-4', 'md:grid-cols-2', 'lg:grid-cols-3')}
>
{Array.from({ length: cardCount }, (_, i) => (
-
-
+
+
+
+
+ Balances
+
))}
diff --git a/src/components/Select/Select.tsx b/src/components/Select/Select.tsx
index 7027a616..b6268f29 100644
--- a/src/components/Select/Select.tsx
+++ b/src/components/Select/Select.tsx
@@ -46,7 +46,7 @@ export default function Select(props: Props) {
(option) => option?.value === props.defaultValue || option?.denom === props.defaultValue,
),
)
- }, [value, props.defaultValue, props.options])
+ }, [value, props.defaultValue, props.options, selected])
return (
price.denom === coin.denom)
+ const asset = getMarketAssets().find((asset) => asset.denom === coin.denom)
+ const displayPrice = prices.find((price) => price.denom === displayCurrency.denom)
+
+ if (!price || !asset || !displayPrice) return '0'
+
+ return BN(coin.amount)
+ .shiftedBy(-1 * asset.decimals)
+ .times(price.amount)
+ .div(displayPrice.amount)
+ .toNumber()
+}