mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-07-27 08:30:02 +03:00
Basically works
This commit is contained in:
parent
d32d4f3a77
commit
2e4ec4a58c
|
@ -1,13 +1,11 @@
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
import { bindActionCreators } from 'redux';
|
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { Container, Notification } from 'devui';
|
import { Container, Notification } from 'devui';
|
||||||
import { liftedDispatch, getReport } from '@redux-devtools/app/lib/actions';
|
|
||||||
import { getActiveInstance } from '@redux-devtools/app/lib/reducers/instances';
|
import { getActiveInstance } from '@redux-devtools/app/lib/reducers/instances';
|
||||||
import Settings from '@redux-devtools/app/lib/components/Settings';
|
import Settings from '@redux-devtools/app/lib/components/Settings';
|
||||||
import Actions from '@redux-devtools/app/lib/containers/Actions';
|
import Actions from '@redux-devtools/app/lib/containers/Actions';
|
||||||
import Header from '@redux-devtools/app/lib/components/Header';
|
import Header from '@redux-devtools/app/lib/components/Header';
|
||||||
|
import { clearNotification } from '@redux-devtools/app/lib/actions';
|
||||||
|
|
||||||
class App extends Component {
|
class App extends Component {
|
||||||
openWindow = (position) => {
|
openWindow = (position) => {
|
||||||
|
@ -64,46 +62,19 @@ class App extends Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
App.propTypes = {
|
|
||||||
bgStore: PropTypes.object,
|
|
||||||
liftedDispatch: PropTypes.func.isRequired,
|
|
||||||
getReport: PropTypes.func.isRequired,
|
|
||||||
togglePersist: PropTypes.func.isRequired,
|
|
||||||
selected: PropTypes.string,
|
|
||||||
liftedState: PropTypes.object.isRequired,
|
|
||||||
monitorState: PropTypes.object,
|
|
||||||
options: PropTypes.object.isRequired,
|
|
||||||
monitor: PropTypes.string,
|
|
||||||
position: PropTypes.string,
|
|
||||||
reports: PropTypes.array.isRequired,
|
|
||||||
dispatcherIsOpen: PropTypes.bool,
|
|
||||||
sliderIsOpen: PropTypes.bool,
|
|
||||||
};
|
|
||||||
|
|
||||||
function mapStateToProps(state) {
|
function mapStateToProps(state) {
|
||||||
const instances = state.instances;
|
const instances = state.instances;
|
||||||
const id = getActiveInstance(instances);
|
const id = getActiveInstance(instances);
|
||||||
return {
|
return {
|
||||||
selected: instances.selected,
|
|
||||||
liftedState: instances.states[id],
|
|
||||||
monitorState: state.monitor.monitorState,
|
|
||||||
options: instances.options[id],
|
options: instances.options[id],
|
||||||
monitor: state.monitor.selected,
|
section: state.section,
|
||||||
dispatcherIsOpen: state.monitor.dispatcherIsOpen,
|
theme: state.theme,
|
||||||
sliderIsOpen: state.monitor.sliderIsOpen,
|
notification: state.notification,
|
||||||
reports: state.reports.data,
|
|
||||||
shouldSync: state.instances.sync,
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function mapDispatchToProps(dispatch) {
|
const actionCreators = {
|
||||||
return {
|
clearNotification,
|
||||||
liftedDispatch: bindActionCreators(liftedDispatch, dispatch),
|
|
||||||
getReport: bindActionCreators(getReport, dispatch),
|
|
||||||
togglePersist: () => {
|
|
||||||
dispatch({ type: 'TOGGLE_PERSIST' });
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
}
|
|
||||||
|
|
||||||
export default connect(mapStateToProps, mapDispatchToProps)(App);
|
export default connect(mapStateToProps, actionCreators)(App);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user