refactor onselect

This commit is contained in:
Sol
2020-07-27 14:49:01 +01:00
committed by Lachlan Kermode
parent f525bbbf02
commit e04fb2ebfb
5 changed files with 7 additions and 12 deletions

View File

@@ -13,8 +13,7 @@ function MapEvents ({
onSelect,
svg,
locations,
eventRadius,
onSelectNarrative
eventRadius
}) {
function getCoordinatesForPercent (radius, percent) {
const x = radius * Math.cos(2 * Math.PI * percent)
@@ -144,7 +143,7 @@ function MapEvents ({
<g
className={`location-event ${narrative ? 'no-hover' : ''}`}
transform={`translate(${x}, ${y})`}
onClick={(!narrative) ? () => onSelect(location.events) : () => { onSelectNarrative(narrativeIdx); onSelect(location.events) }}
onClick={(!narrative) ? () => onSelect(location.events) : () => { onSelect(narrativeIdx); onSelect(location.events) }}
>
{renderLocationSlicesByCategory(location)}
{extraRender ? extraRender() : null}