Files
freeCodeCamp/common/app/components/Map-Drawer.jsx
Berkeley Martinez 8169e9e785 Add map drawer
This commit break map css. Will need to refactor how the map renders
2016-07-28 23:39:17 -07:00

31 lines
745 B
JavaScript

import React, { PropTypes } from 'react';
import NoSSR from 'react-no-ssr';
import Drawer from './Drawer.jsx';
import ShowMap from '../routes/challenges/components/map/Show.jsx';
export default class MapDrawer extends React.Component {
static displayName = 'MapDrawer';
static propTypes = {
isOpen: PropTypes.bool,
isAlreadyLoaded: PropTypes.bool,
toggleMapDrawer: PropTypes.func
};
render() {
const { isOpen, isAlreadyLoaded, toggleMapDrawer } = this.props;
return (
<Drawer
closeDrawer={ toggleMapDrawer }
isOpen={ isOpen }
>
<NoSSR>
<div>
{ isAlreadyLoaded || isOpen ? <ShowMap /> : null }
</div>
</NoSSR>
</Drawer>
);
}
}