@@ -33,7 +33,6 @@ import { getLocation } from '../SideContentHelper';
3333import { NonStoryWorkspaceLocation , SideContentTab , SideContentType } from '../SideContentTypes' ;
3434
3535type StateProps = {
36- editorWidth ?: string ;
3736 sideContentHeight ?: number ;
3837 stepsTotal : number ;
3938 currentStep : number ;
@@ -61,15 +60,7 @@ type DispatchProps = {
6160const calculateWidth = ( editorWidth ?: string ) => {
6261 const horizontalPadding = 50 ;
6362 const maxWidth = 5000 ; // limit for visible diagram width for huge screens
64- let width ;
65- if ( editorWidth === undefined ) {
66- width = window . innerWidth - horizontalPadding ;
67- } else {
68- width = Math . min (
69- maxWidth ,
70- ( window . innerWidth * ( 100 - parseFloat ( editorWidth ) ) ) / 100 - horizontalPadding
71- ) ;
72- }
63+ const width = window . innerWidth - horizontalPadding ;
7364 return Math . min ( width , maxWidth ) ;
7465} ;
7566
@@ -91,6 +82,7 @@ const calculateHeight = (sideContentHeight?: number) => {
9182type Props = OwnProps & StateProps & DispatchProps ;
9283
9384const SideContentCseMachineBase : React . FC < Props > = ( {
85+ // DispatchProps
9486 handleStepUpdate,
9587 handleEditorEval,
9688 setEditorHighlightedLines,
@@ -99,7 +91,7 @@ const SideContentCseMachineBase: React.FC<Props> = ({
9991} ) => {
10092 const [ visualization , setVisualization ] = useState < React . ReactNode > ( null ) ;
10193 const [ value , setValue ] = useState ( - 1 ) ;
102- const [ width , setWidth ] = useState ( calculateWidth ( props . editorWidth ) ) ;
94+ const [ width , setWidth ] = useState ( calculateWidth ( ) ) ;
10395 const [ height , setHeight ] = useState ( calculateHeight ( props . sideContentHeight ) ) ;
10496 const [ , setLastStep ] = useState ( false ) ;
10597 const [ stepLimitExceeded , setStepLimitExceeded ] = useState ( false ) ;
@@ -109,15 +101,15 @@ const SideContentCseMachineBase: React.FC<Props> = ({
109101 const handleResize = useMemo (
110102 ( ) =>
111103 debounce ( ( ) => {
112- const newWidth = calculateWidth ( props . editorWidth ) ;
104+ const newWidth = calculateWidth ( ) ;
113105 const newHeight = calculateHeight ( props . sideContentHeight ) ;
114106 if ( newWidth !== width || newHeight !== height ) {
115107 setWidth ( newWidth ) ;
116108 setHeight ( newHeight ) ;
117109 CseMachine . updateDimensions ( newWidth , newHeight ) ;
118110 }
119111 } , 300 ) ,
120- [ props . editorWidth , props . sideContentHeight , width , height ]
112+ [ props . sideContentHeight , width , height ]
121113 ) ;
122114
123115 useEffect ( ( ) => {
0 commit comments