File tree Expand file tree Collapse file tree 3 files changed +23
-9
lines changed Expand file tree Collapse file tree 3 files changed +23
-9
lines changed Original file line number Diff line number Diff line change @@ -206,6 +206,10 @@ class Panel extends React.Component {
206206
207207 render ( ) {
208208 if ( this . state . loading ) {
209+ // TODO: This currently shows in the Firefox shell when navigating from a
210+ // React page to a non-React page. We should show a better message but
211+ // properly doing so probably requires refactoring how we load the panel
212+ // and communicate with the bridge.
209213 return (
210214 < div style = { styles . loading } >
211215 < h1 > Connecting to React...</ h1 >
@@ -215,7 +219,7 @@ class Panel extends React.Component {
215219 ) ;
216220 }
217221 if ( ! this . state . isReact ) {
218- return < div style = { styles . loading } > < h1 > Looking for react ...</ h1 > </ div > ;
222+ return < div style = { styles . loading } > < h1 > Looking for React ...</ h1 > </ div > ;
219223 }
220224 var extraTabs = assign . apply ( null , [ { } ] . concat ( this . plugins . map ( p => p . tabs ( ) ) ) ) ;
221225 var extraPanes = [ ] . concat ( ...this . plugins . map ( p => p . panes ( ) ) ) ;
Original file line number Diff line number Diff line change 1- <!doctype>
1+ <!doctype html >
22< html >
33 < head >
44 < meta charset =utf8 >
1313 flex : 1 ;
1414 display : flex;
1515 }
16+ h1 {
17+ font-size : 24px ;
18+ margin : 16px 0 ;
19+ }
1620 # container {
1721 display : flex;
1822 position : fixed;
2428 font-family : sans-serif;
2529 }
2630 # message {
27- margin : 20px auto;
28- color : # ccc ;
31+ color : # 888 ;
32+ flex : 1 ;
33+ margin : 46px 30px ;
34+ text-align : center;
2935 }
3036 # logs {
3137 position : fixed;
Original file line number Diff line number Diff line change @@ -17,12 +17,11 @@ var Panel = require('../../../frontend/Panel');
1717var React = require ( 'react' ) ;
1818
1919var node = document . getElementById ( 'container' ) ;
20- node . innerHTML = ' <h1>Connecting to devtools </h1>' ;
20+ React . render ( < h1 id = "message" > Looking for React... </ h1 > , node ) ;
2121var port = { } ;
2222
2323function reload ( ) {
2424 React . unmountComponentAtNode ( node ) ;
25- node . innerHTML = '' ;
2625 React . render ( < Panel alreadyFoundReact = { true } { ...config } /> , node ) ;
2726}
2827
@@ -33,13 +32,18 @@ window.addEventListener('message', function(event) {
3332 if ( evt . data === 'show' ) {
3433 reload ( ) ;
3534 } else if ( evt . data === 'unload' ) {
36- node . innerHTML = ' <h1 id="message">Looking for React</h1>' ;
35+ React . render ( < h1 id = "message" > Looking for React... </ h1 > , node ) ;
3736 } else if ( evt . data . type === 'hasReact' ) {
3837 if ( evt . data . val ) {
3938 React . render ( < Panel alreadyFoundReact = { true } { ...config } /> , node ) ;
4039 } else {
41- node . innerHTML =
42- '<h1 id="message">Unable to find React on the page.</h1>' ;
40+ // TODO: Does this actually show up? It seems like either the "Looking
41+ // for React..." at the top of this file shows, or (when navigating
42+ // from a React page to a non-React one) Panel renders the same text.
43+ React . render (
44+ < h1 id = "message" > Unable to find React on the page.</ h1 > ,
45+ node
46+ ) ;
4347 }
4448 }
4549 } ;
You can’t perform that action at this time.
0 commit comments