Fixes the styling for custom-wrapped components

This commit is contained in:
Oleg Silkin 2019-12-03 20:30:29 -05:00 committed by Sean Yesmunt
parent 1173171084
commit fb868a5810

View file

@ -65,18 +65,22 @@ class UriIndicator extends React.PureComponent<Props> {
return inner; return inner;
} }
const Wrapper = addTooltip if (children) {
? ({ children }) => ( return <Button navigate={channelLink}>{children}</Button>;
<Tooltip label={<ClaimPreview uri={channelLink} type="tooltip" placeholder={false} />}>{children}</Tooltip> } else {
) const Wrapper = addTooltip
: 'span'; ? ({ children }) => (
/* to wrap the UriIndicator element around other DOM nodes as a button */ <Tooltip label={<ClaimPreview uri={channelLink} type="tooltip" placeholder={false} />}>
const content = children ? children : (<Wrapper>{inner}</Wrapper>); {children}
return ( </Tooltip>
<Button className="button--uri-indicator" navigate={channelLink}> )
{content} : 'span';
</Button> return (
); <Button className="button--uri-indicator" navigate={channelLink}>
<Wrapper>{inner}</Wrapper>
</Button>
);
}
} else { } else {
return null; return null;
} }