significantly refactor presentational components

This commit is contained in:
Lachlan Kermode
2019-01-18 11:51:00 +00:00
parent f561064e6c
commit e7cac13fb5
34 changed files with 103 additions and 150 deletions

View File

@@ -0,0 +1,36 @@
import React from 'react';
import { Portal } from 'react-portal';
class MapSelectedEvents extends React.Component {
renderMarker (event) {
const { x, y } = this.props.projectPoint([event.latitude, event.longitude]);
return (
<g
className="location-marker"
transform={`translate(${x - 32}, ${y})`}
>
<path
className="leaflet-interactive"
stroke="#ffffff"
stroke-opacity="1"
stroke-width="3"
stroke-linecap=""
stroke-linejoin="round"
stroke-dasharray="5,2"
fill="none"
d="M0,0a32,32 0 1,0 64,0 a32,32 0 1,0 -64,0 "
>
</path>
</g>
);
}
render() {
return (
<Portal node={this.props.svg}>
{this.props.selected.map(s => this.renderMarker(s))}
</Portal>
)
}
}
export default MapSelectedEvents;