import React, { PureComponent } from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { Col, Row } from 'react-bootstrap'; import ns from './ns.json'; import { Loader } from '../helperComponents'; import SuperBlock from './Super-Block.jsx'; import { superBlocksSelector } from '../redux'; import { fetchMapUi } from './redux'; const mapStateToProps = state => ({ superBlocks: superBlocksSelector(state) }); const mapDispatchToProps = { fetchMapUi }; const propTypes = { fetchMapUi: PropTypes.func.isRequired, params: PropTypes.object, superBlocks: PropTypes.array }; export class ShowMap extends PureComponent { renderSuperBlocks() { const { superBlocks } = this.props; if (!Array.isArray(superBlocks) || !superBlocks.length) { return (
); } return superBlocks.map(dashedName => ( )); } render() { return (
{ this.renderSuperBlocks() }
); } } ShowMap.displayName = 'Map'; ShowMap.propTypes = propTypes; export default connect( mapStateToProps, mapDispatchToProps )(ShowMap);