11import React , { cloneElement , Component , PropTypes } from 'react' ;
22import { sendToBg } from 'crossmessaging' ;
33import styles from 'remotedev-app/lib/styles' ;
4+ import DevTools from 'remotedev-app/lib/containers/DevTools' ;
45import Instances from 'remotedev-app/lib/components/Instances' ;
56import Button from 'remotedev-app/lib/components/Button' ;
67import ImportButton from 'remotedev-app/lib/components/buttons/ImportButton' ;
@@ -10,7 +11,6 @@ import LeftIcon from 'react-icons/lib/md/border-left';
1011import RightIcon from 'react-icons/lib/md/border-right' ;
1112import BottomIcon from 'react-icons/lib/md/border-bottom' ;
1213import RemoteIcon from 'react-icons/lib/go/radio-tower' ;
13- import Monitor from './Monitor' ;
1414
1515let monitorPosition ;
1616if ( location . hash ) monitorPosition = location . hash . substr ( location . hash . indexOf ( '-' ) + 1 ) ;
@@ -23,24 +23,25 @@ export default class App extends Component {
2323 static update = ( ) => ( { } ) ;
2424
2525 handleSelectInstance = e => {
26- this . props . store . instance = e . target . value ;
27- this . props . store . setInstance ( this . props . store . instance , true ) ;
26+ this . props . store . setInstance ( e . target . value ) ;
2827 } ;
2928
3029 openWindow = ( position ) => {
3130 sendToBg ( { type : 'OPEN' , position } ) ;
3231 } ;
3332
3433 render ( ) {
35- const { store, ...childProps } = this . props ;
34+ const { store } = this . props ;
35+ const instances = store . instances ;
36+ const monitor = location . hash && location . hash . substr ( 1 ) . split ( '/' ) [ 0 ] ;
3637 return (
3738 < div style = { styles . container } >
38- { store . instances ?
39+ { instances &&
3940 < div style = { styles . buttonBar } >
40- < Instances instances = { store . instances } onSelect = { this . handleSelectInstance } />
41+ < Instances instances = { instances } onSelect = { this . handleSelectInstance } />
4142 </ div >
42- : null }
43- < Monitor { ... childProps } />
43+ }
44+ < DevTools monitor = { monitor } store = { store } key = { ` ${ monitor } - ${ store . instance } ` } />
4445 { chrome . runtime . openOptionsPage ?
4546 < div style = { styles . buttonBar } >
4647 { monitorPosition !== 'left' ?
@@ -61,7 +62,7 @@ export default class App extends Component {
6162 onClick = { ( ) => { this . openWindow ( 'bottom' ) ; } }
6263 />
6364 : null }
64- < ImportButton importState = { store && store . importState } />
65+ < ImportButton importState = { store . importState } />
6566 < ExportButton exportState = { store . getState } />
6667 < Button
6768 Icon = { RemoteIcon }
0 commit comments