Skip to content

Commit 39bd941

Browse files
committed
Use monitors from remotedev-app
1 parent 4419a0b commit 39bd941

File tree

6 files changed

+15
-61
lines changed

6 files changed

+15
-61
lines changed

package.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,6 @@
6161
"react-redux": "^4.4.0",
6262
"redux": "^3.3.1",
6363
"redux-devtools": "^3.2.0",
64-
"redux-devtools-chart-monitor": "^1.4.1",
65-
"redux-devtools-diff-monitor": "^5.0.4",
66-
"redux-devtools-inspector": "^0.5.1",
67-
"redux-devtools-log-monitor": "^1.0.5",
68-
"redux-slider-monitor": "^1.0.2",
69-
"redux-thunk": "^1.0.3",
70-
"remotedev-app": "^0.3.5"
64+
"remotedev-app": "^0.3.8"
7165
}
7266
}

src/app/containers/App.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React, { cloneElement, Component, PropTypes } from 'react';
22
import { sendToBg } from 'crossmessaging';
33
import styles from 'remotedev-app/lib/styles';
4+
import DevTools from 'remotedev-app/lib/containers/DevTools';
45
import Instances from 'remotedev-app/lib/components/Instances';
56
import Button from 'remotedev-app/lib/components/Button';
67
import ImportButton from 'remotedev-app/lib/components/buttons/ImportButton';
@@ -10,7 +11,6 @@ import LeftIcon from 'react-icons/lib/md/border-left';
1011
import RightIcon from 'react-icons/lib/md/border-right';
1112
import BottomIcon from 'react-icons/lib/md/border-bottom';
1213
import RemoteIcon from 'react-icons/lib/go/radio-tower';
13-
import Monitor from './Monitor';
1414

1515
let monitorPosition;
1616
if (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}

src/app/containers/DevTools.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/app/containers/DiffMonitor.js

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/app/containers/Monitor.js

Lines changed: 0 additions & 30 deletions
This file was deleted.

src/browser/extension/window/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import React from 'react';
22
import { render } from 'react-dom';
3-
import DevTools from '../../../app/containers/DevTools';
3+
import { connect } from 'react-redux';
4+
import App from '../../../app/containers/App';
45

56
chrome.runtime.getBackgroundPage(background => {
67
const { store, unsubscribe } = background.getStore();
8+
const ConnectedApp = connect(state => state)(App);
79
render(
8-
<DevTools store={store} />,
10+
<ConnectedApp store={store} />,
911
document.getElementById('root')
1012
);
1113
addEventListener('unload', unsubscribe, true);

0 commit comments

Comments
 (0)