mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
* move charts to toolkit * refactor imports * fix tests * change the behavior of the color mode hook and add the noWatermark prop * fix gas tracker test and fix toolkit build
27 lines
723 B
TypeScript
27 lines
723 B
TypeScript
import React from 'react';
|
|
|
|
import type { ChartWidgetProps } from 'toolkit/components/charts/ChartWidget';
|
|
import { ChartWidget } from 'toolkit/components/charts/ChartWidget';
|
|
|
|
import { useChartsConfig } from './config';
|
|
|
|
const ChartWidgetPwStory = ({ charts, ...props }: ChartWidgetProps) => {
|
|
const chartsConfig = useChartsConfig();
|
|
|
|
const modifiedCharts = React.useMemo(() => {
|
|
return charts.map((chart) => {
|
|
if (chart.charts.length === 0) {
|
|
return {
|
|
...chart,
|
|
charts: chartsConfig,
|
|
};
|
|
}
|
|
return chart;
|
|
});
|
|
}, [ charts, chartsConfig ]);
|
|
|
|
return <ChartWidget { ...props } charts={ modifiedCharts }/>;
|
|
};
|
|
|
|
export default React.memo(ChartWidgetPwStory);
|