From 54ada6d9eb89f389bbb711f12371bfd62b40da1d Mon Sep 17 00:00:00 2001 From: bayge Date: Fri, 6 Dec 2024 10:04:14 +1100 Subject: [PATCH] Disable liquidity option in the graph section --- web/src/components/SwapPro/SwapProGraph.tsx | 35 ++------------------- 1 file changed, 3 insertions(+), 32 deletions(-) diff --git a/web/src/components/SwapPro/SwapProGraph.tsx b/web/src/components/SwapPro/SwapProGraph.tsx index e1294a01..f24c6e3b 100644 --- a/web/src/components/SwapPro/SwapProGraph.tsx +++ b/web/src/components/SwapPro/SwapProGraph.tsx @@ -27,9 +27,9 @@ export const Graph = ({ pool?: SwapProPoolFragmentFragment; currentPrice: string; }) => { - const [activeGraphType, setActiveGraphType] = useState< - "price" | "volume" | "liquidity" - >("volume"); + const [activeGraphType, setActiveGraphType] = useState<"price" | "volume">( + "volume", + ); const [duration, setDuration] = useState<"7D" | "1M" | "6M" | "1Y" | "ALL">( "7D", @@ -108,30 +108,6 @@ export const Graph = ({ ]; } - if (activeGraphType === "liquidity") { - // return the data for the duration - let slicedData = pool?.liquidityOverTime[durationKey]; - - if (duration !== "ALL") { - slicedData = slicedData?.slice(0, durationToDays[duration]); - } - slicedData = slicedData?.reverse(); - - const last = slicedData?.at(-1); - // TODO - should liquidity include token1 value as well? - const header = usdFormat(parseFloat(last?.fusdc.valueUsd ?? "0")); - - return [ - slicedData - // reformat pool data to match expected graph data - ?.map((d) => ({ - date: new Date(d.timestamp * 1000), - value: parseFloat(d.fusdc.valueUsd), - })), - header, - ]; - } - // should never reach here return []; }, [ @@ -159,11 +135,6 @@ export const Graph = ({ value: "volume", ref: useRef(), }, - { - label: "Liquidity", - value: "liquidity", - ref: useRef(), - }, ]} />