Files
explore/ui/shared/chart/ChartWidget.pwstory.tsx
tom goriunovandGitHub 5c0c18149d Move charts to toolkit and improve color mode hook (#3075)
* 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
2025-10-21 17:33:04 +02:00

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);