From bb723479d49e0b1b2e184aa5836cf3d7d331a93e Mon Sep 17 00:00:00 2001 From: Tien Nguyen Date: Wed, 25 Dec 2024 23:36:54 +0700 Subject: [PATCH] remove chart cursor --- .../LiquidityChartRangeInput.tsx | 11 -------- .../LiquidityChart/components/Brush.tsx | 25 +++---------------- .../LiquidityChart/components/Chart.tsx | 3 --- .../PositionDetail/LiquidityChart/types.ts | 14 ----------- 4 files changed, 4 insertions(+), 49 deletions(-) diff --git a/src/pages/Earns/PositionDetail/LiquidityChart/LiquidityChartRangeInput.tsx b/src/pages/Earns/PositionDetail/LiquidityChart/LiquidityChartRangeInput.tsx index 7894403b27..36ac957507 100644 --- a/src/pages/Earns/PositionDetail/LiquidityChart/LiquidityChartRangeInput.tsx +++ b/src/pages/Earns/PositionDetail/LiquidityChart/LiquidityChartRangeInput.tsx @@ -141,17 +141,6 @@ export default function LiquidityChartRangeInput({ data={{ series: formattedData, current: price }} dimensions={{ width: 400, height: 200 }} margins={{ top: 10, right: 2, bottom: 20, left: 0 }} - styles={{ - area: { - selection: theme.text, - }, - brush: { - handle: { - west: 'transparent', - east: 'transparent', - }, - }, - }} brushLabels={brushLabelValue} brushDomain={brushDomain} onBrushDomainChange={onBrushDomainChangeEnded} diff --git a/src/pages/Earns/PositionDetail/LiquidityChart/components/Brush.tsx b/src/pages/Earns/PositionDetail/LiquidityChart/components/Brush.tsx index 0c9c19e47f..5fad2012a1 100644 --- a/src/pages/Earns/PositionDetail/LiquidityChart/components/Brush.tsx +++ b/src/pages/Earns/PositionDetail/LiquidityChart/components/Brush.tsx @@ -40,8 +40,6 @@ export const Brush = ({ setBrushExtent, innerWidth, innerHeight, - westHandleColor, - eastHandleColor, }: { id: string xScale: ScaleLinear @@ -51,8 +49,6 @@ export const Brush = ({ setBrushExtent: (extent: [number, number], mode: string | undefined) => void innerWidth: number innerHeight: number - westHandleColor: string - eastHandleColor: string }) => { const theme = useTheme() const brushRef = useRef(null) @@ -119,6 +115,10 @@ export const Brush = ({ .attr('stroke', 'none') .attr('fill-opacity', '0.1') .attr('fill', `url(#${id}-gradient-selection)`) + .attr('cursor', 'default') + + select(brushRef.current).selectAll('.overlay').attr('cursor', 'default') + select(brushRef.current).selectAll('.handle').attr('cursor', 'default') }, [brushExtent, brushed, id, innerHeight, innerWidth, interactive, previousBrushExtent, xScale]) // respond to xScale changes only @@ -151,19 +151,6 @@ export const Brush = ({ return useMemo( () => ( <> - - - - - - - {/* clips at exactly the svg area */} - - - - - - {/* will host the d3 brush */} setHovering(false)} /> - {/* custom brush handles */} {localBrushExtent && ( <> - {/* west handle */} {westHandleInView ? ( diff --git a/src/pages/Earns/PositionDetail/LiquidityChart/types.ts b/src/pages/Earns/PositionDetail/LiquidityChart/types.ts index 8935bf099a..fac8f7f3c3 100644 --- a/src/pages/Earns/PositionDetail/LiquidityChart/types.ts +++ b/src/pages/Earns/PositionDetail/LiquidityChart/types.ts @@ -72,20 +72,6 @@ export interface LiquidityChartRangeInputProps { } ticksAtLimit: { [bound in Bound]?: boolean | undefined } - styles: { - area: { - // color of the ticks in range - selection: string - } - - brush: { - handle: { - west: string - east: string - } - } - } - dimensions: Dimensions margins: Margins