+
+ {t("Connect to test networks")}
+ |
+
+ {t("Faucets")}
+
+ >
+ }
+ >
+ setUseTestnets(e.target.checked)} />
+ {
const currency = useSelectedCurrency()
+ const [hideDust] = useSetting("hideDust")
// group balances by token symbol
// TODO: Move the association between a token on multiple chains into the backend / subsquid.
// We will eventually need to handle the scenario where two tokens with the same symbol are not the same token.
- // Also, we might want to separate testnet tokens from non-testnet tokens.
const symbolBalances: SymbolBalances[] = useMemo(() => {
const groupedByToken = balances.each.reduce>((acc, b) => {
if (!b.token) return acc
@@ -112,7 +113,14 @@ export const usePortfolioSymbolBalances = (balances: Balances) => {
return Object.entries(groupedByToken)
.map(([key, tokenBalances]): SymbolBalances => [key, new Balances(tokenBalances)])
.sort(sortSymbolBalancesBy("total", currency))
- }, [balances.each, currency])
+ .filter(
+ hideDust
+ ? ([, balances]) =>
+ balances.each.flatMap((b) => b.token?.coingeckoId ?? []).length === 0 ||
+ balances.sum.fiat("usd").total >= 1
+ : () => true
+ )
+ }, [balances.each, currency, hideDust])
const availableSymbolBalances = useMemo(() => {
const available = symbolBalances
diff --git a/packages/icons/src/icons/chain.svg b/packages/icons/src/icons/chain.svg
index aba677e1a4..d124e5032c 100644
--- a/packages/icons/src/icons/chain.svg
+++ b/packages/icons/src/icons/chain.svg
@@ -1,4 +1,4 @@
\ No newline at end of file
+
diff --git a/packages/icons/src/icons/coins.svg b/packages/icons/src/icons/coins.svg
new file mode 100644
index 0000000000..13acc455ff
--- /dev/null
+++ b/packages/icons/src/icons/coins.svg
@@ -0,0 +1,4 @@
+
diff --git a/packages/icons/src/index.ts b/packages/icons/src/index.ts
index ab434da710..da7ec381d7 100644
--- a/packages/icons/src/index.ts
+++ b/packages/icons/src/index.ts
@@ -1,5 +1,7 @@
export { ReactComponent as BraveIcon } from "./icons/brave.svg"
export { ReactComponent as ChainIcon } from "./icons/chain.svg"
+export { ReactComponent as CoinsIcon } from "./icons/coins.svg"
+export { ReactComponent as CommentIcon } from "./icons/comment.svg"
export { ReactComponent as CursorClickIcon } from "./icons/cursor-click.svg"
export { ReactComponent as CustomTokenGenericIcon } from "./icons/custom-token-generic.svg"
export { ReactComponent as DcentIcon } from "./icons/dcent.svg"
@@ -21,7 +23,6 @@ export { ReactComponent as PolkadotVaultIcon } from "./icons/polkadot-vault.svg"
export { ReactComponent as PopupIcon } from "./icons/popup.svg"
export { ReactComponent as RocketIcon } from "./icons/rocket.svg"
export { ReactComponent as SecretIcon } from "./icons/secret.svg"
-export { ReactComponent as CommentIcon } from "./icons/comment.svg"
export { ReactComponent as SwapIcon } from "./icons/swap.svg"
export { ReactComponent as TableIcon } from "./icons/table.svg"
export { ReactComponent as TalismanHandIcon } from "./icons/talisman-hand.svg"