categoryGroups removed

This commit is contained in:
Unknown
2018-12-03 12:54:33 +00:00
parent 5c23c2ae9a
commit 4f4c80b3a3
3 changed files with 57 additions and 28 deletions

View File

@@ -1,19 +1,21 @@
import React from 'react';
import Map from '../js/map/map.js';
import { areEqual } from '../js/data/utilities.js';
import React from 'react'
import { connect } from 'react-redux'
import * as selectors from '../selectors'
import Map from '../js/map/map.js'
import { areEqual } from '../js/data/utilities.js'
class Viewport extends React.Component {
constructor(props) {
super(props);
super(props)
}
componentDidMount() {
this.map = new Map(this.props.app, this.props.ui, this.props.methods);
this.map.update(this.props.domain, this.props.app);
this.map = new Map(this.props.app, this.props.ui, this.props.methods)
this.map.update(this.props.domain, this.props.app)
}
componentWillReceiveProps(nextProps) {
this.map.update(nextProps.domain, nextProps.app);
this.map.update(nextProps.domain, nextProps.app)
}
render() {
@@ -21,8 +23,30 @@ class Viewport extends React.Component {
<div className='map-wrapper'>
<div id="map" />
</div>
);
)
}
}
export default Viewport;
function mapStateToProps(state) {
return {
domain: {
locations: selectors.selectLocations(state),
narratives: selectors.selectNarratives(state),
categories: selectors.selectCategories(state),
sites: selectors.getSites(state)
},
app: {
views: state.app.filters.views,
selected: state.app.selected,
highlighted: state.app.highlighted,
mapAnchor: state.app.mapAnchor
},
ui: {
dom: state.ui.dom,
narratives: state.ui.style.narratives,
categories: state.ui.style.narratives
}
}
}
export default connect(mapStateToProps)(Viewport)