1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-11-24 09:18:09 +00:00

Added wrapper for tooltip

This commit is contained in:
Vladimir Volek 2018-09-05 11:56:45 +02:00
parent 2dcb2aea7a
commit 8146a78f7d

View File

@ -10,7 +10,7 @@ const TooltipContent = styled.div`
font-size: ${FONT_SIZE.SMALLEST}; font-size: ${FONT_SIZE.SMALLEST};
`; `;
const StyledRcTooltip = styled(RcTooltip)` const Wrapper = styled.div`
.rc-tooltip { .rc-tooltip {
position: absolute; position: absolute;
z-index: 1070; z-index: 1070;
@ -164,7 +164,7 @@ const StyledRcTooltip = styled(RcTooltip)`
.rc-tooltip-placement-bottomLeft .rc-tooltip-arrow { .rc-tooltip-placement-bottomLeft .rc-tooltip-arrow {
left: 15%; left: 15%;
} }
.rc-tooltip-placement-bottomRight .rc-tooltip-arrow { .rc-tooltip-placement-bottomRight .rc-tooltip-arrow {
right: 15%; right: 15%;
} }
@ -173,14 +173,16 @@ const StyledRcTooltip = styled(RcTooltip)`
const Tooltip = ({ const Tooltip = ({
content, placement = 'bottomRight', children, className, content, placement = 'bottomRight', children, className,
}) => ( }) => (
<StyledRcTooltip <Wrapper>
className={className} <RcTooltip
arrowContent={<div className="rc-tooltip-arrow-inner" />} className={className}
placement={placement} arrowContent={<div className="rc-tooltip-arrow-inner" />}
overlay={<TooltipContent>{content}</TooltipContent>} placement={placement}
> overlay={<TooltipContent>{content}</TooltipContent>}
{children} >
</StyledRcTooltip> {children}
</RcTooltip>
</Wrapper>
); );
Tooltip.propTypes = { Tooltip.propTypes = {