Skip to content

Commit

Permalink
feat: remove refetching prop
Browse files Browse the repository at this point in the history
  • Loading branch information
Space-Bean committed Jul 11, 2024
1 parent 7d68ca0 commit 0b21037
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
16 changes: 7 additions & 9 deletions projects/dex-ui/src/components/Well/Chart/Chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function mapChartData(data: IChartDataItem[]) {
}));
}

export const Chart: FC<Props> = ({ legend, data: _data, refetching }) => {
export const Chart: FC<Props> = ({ legend, data: _data }) => {
const chartContainerRef = useRef<any>();
const chart = useRef<IChartApi>();
const lineSeries = useRef<ISeriesApi<"Line">>();
Expand Down Expand Up @@ -119,14 +119,12 @@ export const Chart: FC<Props> = ({ legend, data: _data, refetching }) => {
}, [dataPoint]);

return (
<div>
<ChartContainer ref={chartContainerRef} id="container">
<Legend>
<div>{legend}</div>
<LegendValue>{formatToUSD(dataPointValue || lastDataPoint?.value || 0)}</LegendValue>
</Legend>
</ChartContainer>
</div>
<ChartContainer ref={chartContainerRef} id="container">
<Legend>
<div>{legend}</div>
<LegendValue>{formatToUSD(dataPointValue || lastDataPoint?.value || 0)}</LegendValue>
</Legend>
</ChartContainer>
);
};

Expand Down
8 changes: 2 additions & 6 deletions projects/dex-ui/src/components/Well/Chart/ChartSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -251,12 +251,8 @@ const ChartSectionContent: FC<{ well: Well }> = ({ well }) => {
</ChartLoader>
) : (
<>
{tab === 0 && !error && (
<Chart data={liquidityData} legend={"TOTAL LIQUIDITY"} refetching={isRefetching} />
)}
{tab === 1 && !error && (
<Chart data={volumeData} legend={"HOURLY VOLUME"} refetching={isRefetching} />
)}
{tab === 0 && !error && <Chart data={liquidityData} legend={"TOTAL LIQUIDITY"} />}
{tab === 1 && !error && <Chart data={volumeData} legend={"HOURLY VOLUME"} />}
</>
)}
</Container>
Expand Down

0 comments on commit 0b21037

Please sign in to comment.