@@ -11,7 +11,6 @@ import {
1111} from "lodash" ;
1212import Draggable , { DraggableData , DraggableEvent } from "react-draggable" ;
1313import { ResizableBox , ResizeCallbackData } from "react-resizable" ;
14- import "react-resizable/css/styles.css" ;
1514import { FontAwesomeIcon } from "@fortawesome/react-fontawesome" ;
1615import {
1716 faArrowsAlt ,
@@ -540,27 +539,22 @@ export default class YoutubePlayer
540539 height : "100%" ,
541540 } ;
542541
543- const maxAvailableWidth = this . getMaxAvailableWidth ( ) ;
544- const dynamicMaxWidth = Math . min ( EXPANDED_WIDTH , maxAvailableWidth ) ;
545- const dynamicMaxHeight = Math . min (
546- EXPANDED_HEIGHT + BUTTON_HEIGHT ,
547- window . innerHeight - ( PLAYER_HEIGHT + BUTTON_HEIGHT + PADDING_TOP )
548- ) ;
549-
550542 const draggableBoundPadding = 10 ;
551543 // width of screen - padding on each side - youtube player width
552544 const leftBound =
553545 document . body . clientWidth - draggableBoundPadding * 2 - width ;
554-
555546 const isCurrentDataSource =
556547 store . get ( currentDataSourceNameAtom ) === this . name ;
557548 const isPlayerVisible = isCurrentDataSource && ! hidePlayer ;
549+ const maxResizableWidth = this . getMaxAvailableWidth ( ) ;
550+ const maxResizableHeight =
551+ window . innerHeight - PLAYER_HEIGHT - BUTTON_HEIGHT - PADDING_TOP ;
558552
559553 return (
560554 < Draggable
561555 handle = ".youtube-drag-handle"
562556 position = { { x, y } }
563- disabled = { isExpanded || isInteracting }
557+ disabled = { isInteracting }
564558 cancel = ".react-resizable-handle"
565559 onDrag = { this . onDrag }
566560 onStart = { this . onInteractionStart }
@@ -572,10 +566,7 @@ export default class YoutubePlayer
572566 } }
573567 >
574568 < div
575- className = { `youtube-wrapper${ ! isPlayerVisible ? " hidden" : "" } ${
576- isExpanded ? " expanded" : ""
577- }
578- ` }
569+ className = { `youtube-wrapper${ ! isPlayerVisible ? " hidden" : "" } ` }
579570 data-testid = "youtube-wrapper"
580571 >
581572 < button
@@ -608,8 +599,8 @@ export default class YoutubePlayer
608599 onResizeStop = { this . onInteractionStop }
609600 resizeHandles = { [ "nw" ] }
610601 minConstraints = { [ DEFAULT_WIDTH , DEFAULT_HEIGHT ] }
611- maxConstraints = { [ dynamicMaxWidth , dynamicMaxHeight ] }
612- axis = { isExpanded ? "none" : " both"}
602+ maxConstraints = { [ maxResizableWidth , maxResizableHeight ] }
603+ axis = " both"
613604 className = "youtube-resizable-container"
614605 >
615606 < YouTube
0 commit comments