Files
freeCodeCamp/common/app/Map/Map.jsx
Berkeley Martinez b1e9a172a2 Feat: anon navbar (#16189)
* chore(React): %s/react-pure-render/React.PureComponent/gc

* fix(Settings): Should redirect to signup when unauthen

* feat(Development): Use SES for mail if defined

* feat(Nav): Show anon navbar when logged in

* fix(server/datasources): Make sure mailhog works if no ses keys are found

LB will use both mail settings if using both local and dev

* fix(Nav): Use text instead of icons

* fix(Nav): Make donate page open in new tab
2017-12-15 15:53:32 -06:00

55 lines
1.2 KiB
JavaScript

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 SuperBlock from './Super-Block.jsx';
import { superBlocksSelector } from '../redux';
const mapStateToProps = state => ({
superBlocks: superBlocksSelector(state)
});
const mapDispatchToProps = {};
const propTypes = {
params: PropTypes.object,
superBlocks: PropTypes.array
};
export class ShowMap extends PureComponent {
renderSuperBlocks(superBlocks) {
if (!Array.isArray(superBlocks) || !superBlocks.length) {
return <div>No Super Blocks</div>;
}
return superBlocks.map(dashedName => (
<SuperBlock
dashedName={ dashedName }
key={ dashedName }
/>
));
}
render() {
const { superBlocks } = this.props;
return (
<Row>
<Col xs={ 12 }>
<div className={ `${ns}-accordion center-block` }>
{ this.renderSuperBlocks(superBlocks) }
<div className='spacer' />
</div>
</Col>
</Row>
);
}
}
ShowMap.displayName = 'Map';
ShowMap.propTypes = propTypes;
export default connect(
mapStateToProps,
mapDispatchToProps
)(ShowMap);