diff --git a/webview/src/plots/components/PlotsContainer.tsx b/webview/src/plots/components/PlotsContainer.tsx index 3f65989b92..c157d23d3f 100644 --- a/webview/src/plots/components/PlotsContainer.tsx +++ b/webview/src/plots/components/PlotsContainer.tsx @@ -23,11 +23,7 @@ import { import { isSelecting } from '../../util/strings' import { isTooltip } from '../../util/helpers' -export interface CommonPlotsContainerProps { - onResize: (size: number) => void -} - -export interface PlotsContainerProps extends CommonPlotsContainerProps { +export interface PlotsContainerProps { sectionCollapsed: boolean sectionKey: Section title: string diff --git a/webview/src/plots/components/checkpointPlots/CheckpointPlotsWrapper.tsx b/webview/src/plots/components/checkpointPlots/CheckpointPlotsWrapper.tsx index 708e5194b3..a1a8b03ef3 100644 --- a/webview/src/plots/components/checkpointPlots/CheckpointPlotsWrapper.tsx +++ b/webview/src/plots/components/checkpointPlots/CheckpointPlotsWrapper.tsx @@ -1,15 +1,13 @@ import { Section } from 'dvc/src/plots/webview/contract' import { MessageFromWebviewType } from 'dvc/src/webview/contract' import React, { useEffect, useState } from 'react' -import { useSelector, useDispatch } from 'react-redux' +import { useSelector } from 'react-redux' import { CheckpointPlots } from './CheckpointPlots' -import { changeSize } from './checkpointPlotsSlice' import { PlotsContainer } from '../PlotsContainer' import { sendMessage } from '../../../shared/vscode' import { PlotsState } from '../../store' export const CheckpointPlotsWrapper: React.FC = () => { - const dispatch = useDispatch() const { plotsIds, size, selectedMetrics, isCollapsed, colors } = useSelector( (state: PlotsState) => state.checkpoint ) @@ -29,10 +27,6 @@ export const CheckpointPlotsWrapper: React.FC = () => { }) } - const handleResize = (size: number) => { - dispatch(changeSize(size)) - } - const menu = plotsIds.length > 0 ? { @@ -49,7 +43,6 @@ export const CheckpointPlotsWrapper: React.FC = () => { menu={menu} currentSize={size} sectionCollapsed={isCollapsed} - onResize={handleResize} > diff --git a/webview/src/plots/components/comparisonTable/ComparisonTableWrapper.tsx b/webview/src/plots/components/comparisonTable/ComparisonTableWrapper.tsx index e7d07f960f..476c4cf9fb 100644 --- a/webview/src/plots/components/comparisonTable/ComparisonTableWrapper.tsx +++ b/webview/src/plots/components/comparisonTable/ComparisonTableWrapper.tsx @@ -1,19 +1,14 @@ import { Section } from 'dvc/src/plots/webview/contract' import React from 'react' -import { useSelector, useDispatch } from 'react-redux' +import { useSelector } from 'react-redux' import { ComparisonTable } from './ComparisonTable' -import { changeSize } from './comparisonTableSlice' import { PlotsContainer } from '../PlotsContainer' import { PlotsState } from '../../store' export const ComparisonTableWrapper: React.FC = () => { - const dispatch = useDispatch() const { size, isCollapsed } = useSelector( (state: PlotsState) => state.comparison ) - const handleResize = (size: number) => { - dispatch(changeSize(size)) - } return ( { sectionKey={Section.COMPARISON_TABLE} currentSize={size} sectionCollapsed={isCollapsed} - onResize={handleResize} > diff --git a/webview/src/plots/components/templatePlots/TemplatePlotsWrapper.tsx b/webview/src/plots/components/templatePlots/TemplatePlotsWrapper.tsx index 2b45f58120..1f0ed0b4fc 100644 --- a/webview/src/plots/components/templatePlots/TemplatePlotsWrapper.tsx +++ b/webview/src/plots/components/templatePlots/TemplatePlotsWrapper.tsx @@ -1,28 +1,20 @@ import { Section } from 'dvc/src/plots/webview/contract' import React from 'react' -import { useSelector, useDispatch } from 'react-redux' +import { useSelector } from 'react-redux' import { TemplatePlots } from './TemplatePlots' -import { changeSize } from './templatePlotsSlice' import { PlotsContainer } from '../PlotsContainer' import { PlotsState } from '../../store' export const TemplatePlotsWrapper: React.FC = () => { - const dispatch = useDispatch() const { size, isCollapsed } = useSelector( (state: PlotsState) => state.template ) - - const handleResize = (size: number) => { - dispatch(changeSize(size)) - } - return (