File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import React , { Component } from 'react' ;
2-
2+ import ReactResizeDetector from 'react-resize-detector' ;
33import { PythonConsole } from '@metacell/geppetto-meta-ui/python-console/PythonConsole' ;
44
55export class NetPyNEPythonConsole extends Component {
6-
76 shouldComponentUpdate ( nextProps ) {
87 if ( this . props . extensionLoaded !== nextProps . extensionLoaded ) {
98 return true ;
109 }
1110 return false ;
1211 }
1312
14- componentWillUnmount ( ) {
15- console . info ( "unmounting python console" ) ;
16- }
17-
18- componentDidMount ( ) {
19-
13+ componentWillUnmount ( ) {
14+ console . info ( 'unmounting python console' ) ;
2015 }
2116
22- render ( ) {
17+ render ( ) {
2318 const notebookName = GEPPETTO_CONFIGURATION . notebookName || "notebook.ipynb" ;
24- return < PythonConsole pythonNotebookPath = { `notebooks/${ notebookName } ` } extensionLoaded = { this . props . extensionLoaded } />
19+ return (
20+ < ReactResizeDetector handleWidth handleHeight >
21+ { ( { width, height } ) => < PythonConsole pythonNotebookPath = { `notebooks/${ notebookName } ` } extensionLoaded = { this . props . extensionLoaded } iframeHeight = { height } /> }
22+ </ ReactResizeDetector >
23+ ) ;
2524 }
2625}
2726
Original file line number Diff line number Diff line change 3535 "react-dom" : " ^16.4.0" ,
3636 "react-json-view" : " ^1.21.3" ,
3737 "react-redux" : " ^7.2.0" ,
38+ "react-resize-detector" : " ^6.7.4" ,
3839 "react-sortable-tree" : " ^2.8.0" ,
3940 "redux" : " 4.1.2" ,
4041 "sass" : " ^1.49.0" ,
7879 "less-loader" : " ^5.0.0" ,
7980 "mini-css-extract-plugin" : " ^0.7.0" ,
8081 "raw-loader" : " ^0.5.1" ,
81- "react-resize-detector" : " ^6.7.4" ,
8282 "style-loader" : " ^0.13.2" ,
8383 "three" : " >=0.111.0" ,
8484 "typedoc" : " ^0.11.1" ,
Original file line number Diff line number Diff line change 3535 "react-dom": "^16.4.0",
3636 "react-json-view": "^1.21.3",
3737 "react-redux": "^7.2.0",
38+ "react-resize-detector": "^6.7.4",
3839 "react-sortable-tree": "^2.8.0",
3940 "redux": "4.1.2",
4041 "sass": "^1.49.0",
7879 "less-loader": "^5.0.0",
7980 "mini-css-extract-plugin": "^0.7.0",
8081 "raw-loader": "^0.5.1",
81- "react-resize-detector": "^6.7.4",
8282 "style-loader": "^0.13.2",
8383 "three": ">=0.111.0",
8484 "typedoc": "^0.11.1",
Original file line number Diff line number Diff line change 3535 "react-dom" : " ^16.4.0" ,
3636 "react-json-view" : " ^1.21.3" ,
3737 "react-redux" : " ^7.2.0" ,
38+ "react-resize-detector" : " ^6.7.4" ,
3839 "react-sortable-tree" : " ^2.8.0" ,
3940 "redux" : " 4.1.2" ,
4041 "sass" : " ^1.49.0" ,
7879 "less-loader" : " ^5.0.0" ,
7980 "mini-css-extract-plugin" : " ^0.7.0" ,
8081 "raw-loader" : " ^0.5.1" ,
81- "react-resize-detector" : " ^6.7.4" ,
8282 "style-loader" : " ^0.13.2" ,
8383 "three" : " >=0.111.0" ,
8484 "typedoc" : " ^0.11.1" ,
You can’t perform that action at this time.
0 commit comments