diff --git a/src/components/Analysis/MaxConsumptionCard/MaxConsumptionCard.tsx b/src/components/Analysis/MaxConsumptionCard/MaxConsumptionCard.tsx index 6f4999904aa63d587f394ef9492e80e4ee3f3498..d0296f384b36ff0b5017a7a6a2d39f5b6712326d 100644 --- a/src/components/Analysis/MaxConsumptionCard/MaxConsumptionCard.tsx +++ b/src/components/Analysis/MaxConsumptionCard/MaxConsumptionCard.tsx @@ -169,6 +169,7 @@ const MaxConsumptionCard = ({ chartData={chartData} fluidType={currentFluid} timeStep={TimeStep.DAY} + showCompare={false} height={height} width={width} isSwitching={false} diff --git a/src/components/Analysis/MaxConsumptionCard/__snapshots__/MaxConsumptionCard.spec.tsx.snap b/src/components/Analysis/MaxConsumptionCard/__snapshots__/MaxConsumptionCard.spec.tsx.snap index 1bc6803b2a13f24a1c35bbd34aa16c89292a1b2e..10886a7a5e2e3a63fc7d358651ab0e4b56f360b9 100644 --- a/src/components/Analysis/MaxConsumptionCard/__snapshots__/MaxConsumptionCard.spec.tsx.snap +++ b/src/components/Analysis/MaxConsumptionCard/__snapshots__/MaxConsumptionCard.spec.tsx.snap @@ -529,6 +529,7 @@ exports[`MaxConsumptionCard component should be rendered correctly 1`] = ` fluidType={0} height={250} isSwitching={false} + showCompare={false} timeStep={20} width={940} /> diff --git a/src/components/Charts/BarChart.tsx b/src/components/Charts/BarChart.tsx index 8cc731f8b494b9b0158cf1564517580ebfed0c5d..fb4378fbe836888b44f24239449317f4b1afeb9b 100644 --- a/src/components/Charts/BarChart.tsx +++ b/src/components/Charts/BarChart.tsx @@ -8,12 +8,12 @@ import { TimeStep } from 'enum/timeStep.enum' import { DateTime } from 'luxon' import { Datachart } from 'models' import React from 'react' -import { useAppSelector } from 'store/hooks' export interface BarChartProps { chartData: Datachart fluidType: FluidType timeStep: TimeStep + showCompare: boolean width?: number height?: number marginLeft?: number @@ -28,6 +28,7 @@ const BarChart = ({ chartData, fluidType, timeStep, + showCompare, width = 600, height = 400, marginLeft = 10, @@ -37,7 +38,6 @@ const BarChart = ({ isSwitching, clickable = true, }: BarChartProps) => { - const { showCompare } = useAppSelector(state => state.ecolyo.chart) const getContentWidth = () => { return width - marginLeft - marginRight } diff --git a/src/components/FluidChart/FluidChartSlide.tsx b/src/components/FluidChart/FluidChartSlide.tsx index 22dcca206cc0db86f243c0f4618b44602d2fa7e4..e303144470703f2132cc689f937fcf16178d4904 100644 --- a/src/components/FluidChart/FluidChartSlide.tsx +++ b/src/components/FluidChart/FluidChartSlide.tsx @@ -33,7 +33,7 @@ const FluidChartSlide = ({ const client = useClient() const dispatch = useAppDispatch() const { - chart: { currentTimeStep, currentIndex }, + chart: { currentTimeStep, currentIndex, showCompare }, global: { fluidStatus, fluidTypes }, } = useAppSelector(state => state.ecolyo) @@ -126,6 +126,7 @@ const FluidChartSlide = ({ chartData={chartData} fluidType={fluidType} timeStep={timeStep} + showCompare={showCompare} height={height} width={width} isSwitching={isSwitching}