diff --git a/packages/core/src/components/Container.js b/packages/core/src/components/Container.js index db83c44be..1c2d911b6 100644 --- a/packages/core/src/components/Container.js +++ b/packages/core/src/components/Container.js @@ -61,26 +61,38 @@ const Container = ({ children, theme, isInteractive = true }) => { }) const { isTooltipVisible, tooltipContent, position } = state + let content + if (isInteractive) { + content = ( +
+ {children({ + showTooltip: isInteractive ? showTooltip : noop, + hideTooltip: isInteractive ? hideTooltip : noop, + })} + {isTooltipVisible && ( +
+ {tooltipContent} +
+ )} +
+ ) + } else { + content = children({ + showTooltip: isInteractive ? showTooltip : noop, + hideTooltip: isInteractive ? hideTooltip : noop, + }) + } + return ( -
- {children({ - showTooltip: isInteractive ? showTooltip : noop, - hideTooltip: isInteractive ? hideTooltip : noop, - })} - {isTooltipVisible && ( -
- {tooltipContent} -
- )} -
+ {content}
) diff --git a/website/src/components/icons/ChoroplethIcon.js b/website/src/components/icons/ChoroplethIcon.js index 43ae171ce..14fb02ce2 100644 --- a/website/src/components/icons/ChoroplethIcon.js +++ b/website/src/components/icons/ChoroplethIcon.js @@ -6,7 +6,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ -import React, { Fragment } from 'react' +import React from 'react' import choroplethGreyImg from '../../assets/icons/choropleth-grey.png' import choroplethRedImg from '../../assets/icons/choropleth-red.png' import { Icon } from './styled'