From de79259c7d85c4395aecb4a36a28f5ce3a1bfd3b Mon Sep 17 00:00:00 2001 From: Yuho Date: Wed, 10 Jan 2024 16:45:38 +0800 Subject: [PATCH] responsive ui --- screens/Dashboard/supplyBorrowListMobile.tsx | 28 ++++++++++++++++---- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/screens/Dashboard/supplyBorrowListMobile.tsx b/screens/Dashboard/supplyBorrowListMobile.tsx index 6571e5e5..513a3735 100644 --- a/screens/Dashboard/supplyBorrowListMobile.tsx +++ b/screens/Dashboard/supplyBorrowListMobile.tsx @@ -1,4 +1,4 @@ -import { useState } from "react"; +import React, { useState } from "react"; import { twMerge } from "tailwind-merge"; import styled from "styled-components"; import { ContentBox } from "../../components/ContentBox/ContentBox"; @@ -8,6 +8,7 @@ import { formatTokenValue, formatUSDValue, millifyNumber } from "../../helpers/h import { AdjustButton, MarketButton, RepayButton, WithdrawButton } from "./supplyBorrowButtons"; import { NoDataMascot } from "../../components/Icons/Icons"; import { hiddenAssets } from "../../utils/config"; +import CustomTooltips from "../../components/CustomTooltips/CustomTooltips"; const SupplyBorrowListMobile = ({ suppliedRows, borrowedRows, accountId }) => { const [tabIndex, setTabIndex] = useState(0); @@ -21,7 +22,7 @@ const SupplyBorrowListMobile = ({ suppliedRows, borrowedRows, accountId }) => { if (suppliedRows?.length) { supplyNode = suppliedRows?.map((d) => ( - + )); @@ -133,11 +134,17 @@ const SupplyItem = ({ data }) => { iconImg = token; } else if (tokens?.length) { symbolNode = ""; + let symbolTooltips = ""; iconImg = (
{tokens?.map((d, i) => { const isLast = i === tokens.length - 1; - symbolNode += `${d.metadata.symbol}${!isLast ? "-" : ""}`; + if (tokens?.length > 3) { + symbolTooltips += `${d.metadata.symbol}${!isLast ? "-" : ""}`; + } else { + symbolNode += `${d.metadata.symbol}${!isLast ? "-" : ""}`; + } + return ( { })}
); + + if (tokens?.length > 3) { + symbolNode = ( + + {tokens?.length} pool + + ); + } } return ( @@ -160,10 +178,10 @@ const SupplyItem = ({ data }) => { className="flex justify-between border-b" style={{ padding: "16px", borderColor: "#31344C" }} > -
+
{iconImg}
-
{symbolNode}
+
{symbolNode}
{hiddenAssets.includes(data?.tokenId || "") ? null : (