From 23fa15fe763bdf2870428c3f4bff6e194aab9675 Mon Sep 17 00:00:00 2001 From: 0xKheops <26880866+0xKheops@users.noreply.github.com> Date: Tue, 10 Dec 2024 15:31:36 +0900 Subject: [PATCH] feat: asset details pages adjustments --- .../routes/Portfolio/PortfolioAsset.tsx | 15 ++------ .../popup/pages/Portfolio/PortfolioAsset.tsx | 38 ++++--------------- 2 files changed, 12 insertions(+), 41 deletions(-) diff --git a/apps/extension/src/ui/apps/dashboard/routes/Portfolio/PortfolioAsset.tsx b/apps/extension/src/ui/apps/dashboard/routes/Portfolio/PortfolioAsset.tsx index 5cf835418..f839a2c97 100644 --- a/apps/extension/src/ui/apps/dashboard/routes/Portfolio/PortfolioAsset.tsx +++ b/apps/extension/src/ui/apps/dashboard/routes/Portfolio/PortfolioAsset.tsx @@ -10,7 +10,6 @@ import { Tooltip, TooltipContent, TooltipTrigger } from "talisman-ui" import { Breadcrumb } from "@talisman/components/Breadcrumb" import { NavigateWithQuery } from "@talisman/components/NavigateWithQuery" import { AssetPriceChart } from "@ui/domains/Asset/AssetPriceChart" -import { TokenLogo } from "@ui/domains/Asset/TokenLogo" import { DashboardAssetDetails } from "@ui/domains/Portfolio/AssetDetails" import { DashboardPortfolioHeader } from "@ui/domains/Portfolio/DashboardPortfolioHeader" import { PortfolioToolbarButton } from "@ui/domains/Portfolio/PortfolioToolbarButton" @@ -104,8 +103,7 @@ const SendFundsButton: FC<{ symbol: string }> = ({ symbol }) => { const TokenBreadcrumb: FC<{ symbol: string - token: Token | undefined -}> = ({ symbol, token }) => { +}> = ({ symbol }) => { const { t } = useTranslation() const navigate = useNavigateWithQuery() @@ -117,16 +115,11 @@ const TokenBreadcrumb: FC<{ onClick: () => navigate("/portfolio/tokens"), }, { - label: ( -
- -
{token?.symbol ?? symbol}
-
- ), + label:
{symbol}
, onClick: undefined, }, ] - }, [t, token?.id, token?.symbol, symbol, navigate]) + }, [t, symbol, navigate]) return (
@@ -166,7 +159,7 @@ export const PortfolioAsset = () => { return ( <> - + diff --git a/apps/extension/src/ui/apps/popup/pages/Portfolio/PortfolioAsset.tsx b/apps/extension/src/ui/apps/popup/pages/Portfolio/PortfolioAsset.tsx index 3ba4266aa..af6609831 100644 --- a/apps/extension/src/ui/apps/popup/pages/Portfolio/PortfolioAsset.tsx +++ b/apps/extension/src/ui/apps/popup/pages/Portfolio/PortfolioAsset.tsx @@ -7,23 +7,18 @@ import { Navigate, useNavigate, useParams } from "react-router-dom" import { IconButton } from "talisman-ui" import { Balances } from "@extension/core" -import { AssetPrice } from "@ui/domains/Asset/AssetPrice" import { AssetPriceChart } from "@ui/domains/Asset/AssetPriceChart" import { Fiat } from "@ui/domains/Asset/Fiat" -import { TokenLogo } from "@ui/domains/Asset/TokenLogo" import { PopupAssetDetails } from "@ui/domains/Portfolio/AssetDetails" import { useDisplayBalances } from "@ui/domains/Portfolio/useDisplayBalances" import { usePortfolioNavigation } from "@ui/domains/Portfolio/usePortfolioNavigation" -import { useTokenBalancesSummary } from "@ui/domains/Portfolio/useTokenBalancesSummary" import { useAnalytics } from "@ui/hooks/useAnalytics" -import { useUniswapV2LpTokenTotalValueLocked } from "@ui/hooks/useUniswapV2LpTokenTotalValueLocked" import { useBalances, usePortfolio, useSelectedCurrency, useSetting } from "@ui/state" const PageContent = ({ balances, symbol }: { balances: Balances; symbol: string }) => { const navigate = useNavigate() const balancesToDisplay = useDisplayBalances(balances) const currency = useSelectedCurrency() - const { token, rate } = useTokenBalancesSummary(balancesToDisplay) const handleBackBtnClick = useCallback(() => navigate(-1), [navigate]) @@ -39,38 +34,21 @@ const PageContent = ({ balances, symbol }: { balances: Balances; symbol: string const { t } = useTranslation() - const isUniswapV2LpToken = token?.type === "evm-uniswapv2" - const tvl = useUniswapV2LpTokenTotalValueLocked(token, rate?.price, balances) - return ( <> -
+
-
- -
-
-
-
{symbol}
-
{t("Total")}
-
-
- {isUniswapV2LpToken && typeof tvl === "number" && ( - - )} - {!isUniswapV2LpToken && !!rate && ( - - )} -
- -
-
+
{symbol}
+
+
{t("Total")}
+
- -
+ +
+