1
1
import React , { useEffect , useRef } from 'react' ;
2
2
import BottomTabs from './BottomTabs' ;
3
+ import { ExpandLess , ExpandMore } from '@mui/icons-material' ;
3
4
4
5
const BottomPanel = ( props ) : JSX . Element => {
5
6
let y : number = 0 ;
@@ -15,18 +16,17 @@ const BottomPanel = (props): JSX.Element => {
15
16
//Start listeners when the user clicks the bottom panel tab
16
17
document . addEventListener ( 'mousemove' , mouseMoveHandler ) ;
17
18
document . addEventListener ( 'mouseup' , mouseUpHandler ) ;
18
- window . addEventListener ( 'message' , handleIframeMessage ) ; //listens for messages from the iframe when the mouse is over it
19
+ window . addEventListener ( 'message' , handleIframeMessage ) ; //listens for messages from the iframe when the mouse is over it
19
20
} ;
20
-
21
+
21
22
//Interpret the messages from the iframe
22
23
const handleIframeMessage = ( e ) => {
23
24
if ( e . data === 'iframeMouseUp' ) {
24
25
mouseUpHandler ( ) ;
25
- } else if ( e . data . type === 'iframeMouseMove' ) {
26
- mouseMoveHandler ( e . data )
26
+ } else if ( e . data . type === 'iframeMouseMove' ) {
27
+ mouseMoveHandler ( e . data ) ;
27
28
}
28
- }
29
-
29
+ } ;
30
30
31
31
const mouseMoveHandler = function ( e : MouseEvent ) : void {
32
32
// How far the mouse has been moved
@@ -54,12 +54,21 @@ const BottomPanel = (props): JSX.Element => {
54
54
55
55
return (
56
56
< >
57
- < div className = "bottom-panel" id = "resize" ref = { node } >
58
- < div id = "resize-drag" onMouseDown = { mouseDownHandler } tabIndex = { 0 } >
59
- ......
57
+ < div className = "bottom-panel" id = "resize" ref = { node } >
58
+ < div
59
+ id = "resize-drag"
60
+ onMouseDown = { mouseDownHandler }
61
+ onClick = { ( ) => props . setBottomShow ( true ) }
62
+ tabIndex = { 0 }
63
+ >
64
+ { props . bottomShow ? < ExpandMore /> : < ExpandLess /> }
65
+ </ div >
66
+ < BottomTabs
67
+ setBottomShow = { props . setBottomShow }
68
+ isThemeLight = { props . isThemeLight }
69
+ />
60
70
</ div >
61
- < BottomTabs setBottomShow = { props . setBottomShow } isThemeLight = { props . isThemeLight } />
62
- </ div > </ >
71
+ </ >
63
72
) ;
64
73
} ;
65
74
0 commit comments