{walletPortfolio?.totalValue != null ? (
-
+
+
+
) : (
NBSP
)}
@@ -611,13 +621,27 @@ function OverviewComponent() {
}
>
{`${sign}${change.formatted}`}{' '}
- {walletPortfolio?.change24h.absolute
- ? `(${formatCurrencyValue(
- Math.abs(walletPortfolio.change24h.absolute),
- 'en',
- currency
- )})`
- : ''}{' '}
+ {walletPortfolio?.change24h.absolute ? (
+ <>
+ {'('}
+
+
+ {formatCurrencyValue(
+ Math.abs(walletPortfolio.change24h.absolute),
+ 'en',
+ currency
+ )}
+
+
+ {')'}
+ >
+ ) : (
+ ''
+ )}{' '}
Today
);
diff --git a/src/ui/pages/Overview/Positions/Positions.tsx b/src/ui/pages/Overview/Positions/Positions.tsx
index be3d0ea01..62bdae280 100644
--- a/src/ui/pages/Overview/Positions/Positions.tsx
+++ b/src/ui/pages/Overview/Positions/Positions.tsx
@@ -63,6 +63,7 @@ import { useWalletPortfolio } from 'src/modules/zerion-api/hooks/useWalletPortfo
import type { WalletPortfolio } from 'src/modules/zerion-api/requests/wallet-get-portfolio';
import { usePositionsRefetchInterval } from 'src/ui/transactions/usePositionsRefetchInterval';
import { openHrefInTabIfSidepanel } from 'src/ui/shared/openInTabIfInSidepanel';
+import { HideBalance } from 'src/ui/components/HideBalance';
import {
TAB_SELECTOR_HEIGHT,
TAB_TOP_PADDING,
@@ -234,14 +235,26 @@ function AddressPositionItem({
) : position.quantity ? (
- {formatTokenValue(
- getCommonQuantity({
+
+ {formatTokenValue(
+ getCommonQuantity({
+ asset: position.asset,
+ chain,
+ baseQuantity: position.quantity,
+ }),
+ position.asset.symbol
+ )}
+
) : null,
],
@@ -255,7 +268,13 @@ function AddressPositionItem({
{position.value != null ? (
- {formatCurrencyValue(position.value, 'en', currency)}
+
+ {formatCurrencyValue(position.value, 'en', currency)}
+
{position.asset.price?.relative_change_24h ? (
+ {formatCurrencyValue(absoluteChange, 'en', currency)}
+
+ {')'}
) : null}
@@ -601,9 +628,16 @@ function PositionList({
-
+
+
+
>
) : null}
@@ -703,9 +737,16 @@ function MultiChainPositions({
onChange={onChainChange}
value={
chainTotalValue ? (
-
+
+
+
) : null
}
/>
diff --git a/src/ui/pages/Settings/HideBalancesPage/HideBalancesPage.tsx b/src/ui/pages/Settings/HideBalancesPage/HideBalancesPage.tsx
new file mode 100644
index 000000000..45518e33b
--- /dev/null
+++ b/src/ui/pages/Settings/HideBalancesPage/HideBalancesPage.tsx
@@ -0,0 +1,175 @@
+import { useStore } from '@store-unit/react';
+import React from 'react';
+import CheckIcon from 'jsx:src/ui/assets/check.svg';
+import { useBackgroundKind } from 'src/ui/components/Background';
+import { NavigationTitle } from 'src/ui/components/NavigationTitle';
+import { PageColumn } from 'src/ui/components/PageColumn';
+import { PageTop } from 'src/ui/components/PageTop';
+import { hideBalancesStore } from 'src/ui/features/hide-balances/store';
+import { Frame } from 'src/ui/ui-kit/Frame';
+import { FrameListItemButton } from 'src/ui/ui-kit/FrameList';
+import { HStack } from 'src/ui/ui-kit/HStack';
+import { VStack } from 'src/ui/ui-kit/VStack';
+import { UIText } from 'src/ui/ui-kit/UIText';
+import { useWalletPortfolio } from 'src/modules/zerion-api/hooks/useWalletPortfolio';
+import { useCurrency } from 'src/modules/currency/useCurrency';
+import { useAddressParams } from 'src/ui/shared/user-address/useAddressParams';
+import { useHttpClientSource } from 'src/modules/zerion-api/hooks/useHttpClientSource';
+import { HideBalance } from 'src/ui/components/HideBalance';
+import { NeutralDecimals } from 'src/ui/ui-kit/NeutralDecimals';
+import { formatCurrencyToParts } from 'src/shared/units/formatCurrencyValue';
+import { Spacer } from 'src/ui/ui-kit/Spacer';
+
+function TotalValue() {
+ const { currency } = useCurrency();
+ const { params, ready } = useAddressParams();
+ const { data } = useWalletPortfolio(
+ { addresses: [params.address], currency },
+ { source: useHttpClientSource() },
+ { enabled: ready, refetchInterval: 40000 }
+ );
+ const walletPortfolio = data?.data;
+ if (walletPortfolio?.totalValue == null) {
+ return null;
+ }
+ return (
+
+
+
+ );
+}
+
+const sections = [
+ {
+ title: 'Default',
+ mode: hideBalancesStore.MODE.default,
+ },
+ {
+ title: 'Poor Mode',
+ sections: [
+ {
+ title: 'Default Poor',
+ mode: hideBalancesStore.MODE.poorMode1,
+ },
+ {
+ title: 'x10 Poor',
+ mode: hideBalancesStore.MODE.poorMode2,
+ },
+ {
+ title: 'x100 Poor',
+ mode: hideBalancesStore.MODE.poorMode3,
+ },
+ ],
+ },
+ {
+ title: 'Blurred',
+ mode: hideBalancesStore.MODE.blurred,
+ },
+];
+
+function Row({
+ text,
+ checked,
+ onClick,
+ nested,
+}: {
+ text: string;
+ checked: boolean;
+ onClick: null | (() => void);
+ nested: boolean;
+}) {
+ const content = (
+
+ {text}
+ {checked ? (
+
+ ) : null}
+
+ );
+ if (onClick) {
+ return (
+
+ {content}
+
+ );
+ } else {
+ return {content}
;
+ }
+}
+
+export function HideBalancesPage() {
+ useBackgroundKind({ kind: 'white' });
+ const { mode: currentMode } = useStore(hideBalancesStore);
+ // const goBack = useGoBack();
+
+ return (
+
+
+
+
+
+
+ {sections.map((section) => {
+ return (
+
+ hideBalancesStore.setMode(section.mode)
+ : null
+ }
+ />
+ {section.sections?.map((subSection) => (
+
+ hideBalancesStore.setMode(subSection.mode)}
+ />
+
+ ))}
+
+ );
+ })}
+
+
+
+
+ Example
+
+
+
+
+
+ );
+}
diff --git a/src/ui/pages/Settings/HideBalancesPage/index.ts b/src/ui/pages/Settings/HideBalancesPage/index.ts
new file mode 100644
index 000000000..53da7e958
--- /dev/null
+++ b/src/ui/pages/Settings/HideBalancesPage/index.ts
@@ -0,0 +1 @@
+export { HideBalancesPage } from './HideBalancesPage';
diff --git a/src/ui/pages/Settings/Preferences.tsx b/src/ui/pages/Settings/Preferences.tsx
index d965f7ef7..99e5a6eb8 100644
--- a/src/ui/pages/Settings/Preferences.tsx
+++ b/src/ui/pages/Settings/Preferences.tsx
@@ -20,6 +20,7 @@ import { VStack } from 'src/ui/ui-kit/VStack';
import CheckIcon from 'jsx:src/ui/assets/check.svg';
import { preferenceStore } from 'src/ui/features/appearance';
import { useGoBack } from 'src/ui/shared/navigation/useGoBack';
+import { HideBalancesPage } from './HideBalancesPage';
function CurrencyPage() {
const { currency } = useCurrency();
@@ -86,24 +87,44 @@ function PreferencesMain() {
-
-
-
-
-
- Currency
-
- {CURRENCIES[currency].code.toUpperCase()}
-
-
-
-
-
-
+
+
+
+
+
+
+ Currency
+
+ {CURRENCIES[currency].code.toUpperCase()}
+
+
+
+
+
+
+
+
+
+
+
+ Hide Balances
+
+ Shift+H
+
+
+
+
+
+
+
);
@@ -128,6 +149,14 @@ export function PreferencesPage() {
}
/>
+
+
+
+ }
+ />
);
}
diff --git a/src/ui/pages/WalletSelect/WalletList.tsx b/src/ui/pages/WalletSelect/WalletList.tsx
index 7b4d1b237..1843161ad 100644
--- a/src/ui/pages/WalletSelect/WalletList.tsx
+++ b/src/ui/pages/WalletSelect/WalletList.tsx
@@ -22,6 +22,7 @@ import { CopyButton } from 'src/ui/components/CopyButton';
import { useCurrency } from 'src/modules/currency/useCurrency';
import { normalizeAddress } from 'src/shared/normalizeAddress';
import { VStack } from 'src/ui/ui-kit/VStack';
+import { HideBalance } from 'src/ui/components/HideBalance';
import * as styles from './styles.module.css';
function WalletListItem({
@@ -185,13 +186,20 @@ function WalletListItem({
render={(query) => (
{query.data ? (
-
+
+
+
) : (
NBSP
)}
diff --git a/src/ui/pages/WalletSelect/WalletSelect.tsx b/src/ui/pages/WalletSelect/WalletSelect.tsx
index 96365229d..a289e1ad1 100644
--- a/src/ui/pages/WalletSelect/WalletSelect.tsx
+++ b/src/ui/pages/WalletSelect/WalletSelect.tsx
@@ -33,6 +33,7 @@ import { getWalletParams } from 'src/ui/shared/requests/useWalletParams';
import { UnstyledAnchor } from 'src/ui/ui-kit/UnstyledAnchor';
import { useWalletsMetaByChunks } from 'src/ui/shared/requests/useWalletsMetaByChunks';
import { emitter } from 'src/ui/shared/events';
+import { HideBalance } from 'src/ui/components/HideBalance';
import * as styles from './styles.module.css';
import { WalletList } from './WalletList';
@@ -65,13 +66,20 @@ function PortfolioRow({ walletGroups }: { walletGroups: WalletGroup[] }) {
{isLoading || !walletPortfolio ? (
ellipsis
) : (
-
+
+
+
)}
}
diff --git a/src/ui/shared/requests/PortfolioValue/ChainValue/ChainValue.tsx b/src/ui/shared/requests/PortfolioValue/ChainValue/ChainValue.tsx
index 5449422cc..cd5d59796 100644
--- a/src/ui/shared/requests/PortfolioValue/ChainValue/ChainValue.tsx
+++ b/src/ui/shared/requests/PortfolioValue/ChainValue/ChainValue.tsx
@@ -1,8 +1,9 @@
-import type React from 'react';
+import React from 'react';
import type { Chain } from 'src/modules/networks/Chain';
import type { WalletPortfolio } from 'src/modules/zerion-api/requests/wallet-get-portfolio';
import { NetworkSelectValue } from 'src/modules/networks/NetworkSelectValue';
import { formatCurrencyValue } from 'src/shared/units/formatCurrencyValue';
+import { HideBalance } from 'src/ui/components/HideBalance';
export type ChainDistribution = Pick<
WalletPortfolio,
@@ -18,14 +19,16 @@ export function ChainValue({
chainDistribution: ChainDistribution | null;
currency: string;
}) {
- const value =
+ const maybeValue =
chain === NetworkSelectValue.All
? chainDistribution?.totalValue
: chainDistribution?.positionsChainsDistribution[chain.toString()];
- return formatCurrencyValue(
- value || 0,
- 'en',
- currency
- ) as React.ReactNode as JSX.Element;
+ const value = maybeValue || 0;
+
+ return (
+
+ {formatCurrencyValue(value, 'en', currency)}
+
+ );
}
diff --git a/src/ui/shared/useProfileName.ts b/src/ui/shared/useProfileName.ts
index 0cfe0bce9..ac61b292c 100644
--- a/src/ui/shared/useProfileName.ts
+++ b/src/ui/shared/useProfileName.ts
@@ -27,12 +27,13 @@ export function useProfileName(
{
padding = 5,
maxCharacters,
- }: { padding?: number; maxCharacters?: number } = {}
+ enabled = true,
+ }: { padding?: number; maxCharacters?: number; enabled?: boolean } = {}
): { type: WalletNameType; value: string } {
const { isLoading: isDomainLoading, data: domain } = useQuery({
queryKey: persistentQuery([lookupAddressNameKey, wallet.address]),
queryFn: async () => lookupAddressName(wallet.address),
- enabled: !wallet.name,
+ enabled: enabled && !wallet.name,
suspense: false,
refetchOnWindowFocus: false,
refetchOnMount: false,