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;
}
const Wrapper = addTooltip
? ({ children }) => (
<Tooltip label={<ClaimPreview uri={channelLink} type="tooltip" placeholder={false} />}>{children}</Tooltip>
)
: 'span';
/* to wrap the UriIndicator element around other DOM nodes as a button */
const content = children ? children : (<Wrapper>{inner}</Wrapper>);
return (
<Button className="button--uri-indicator" navigate={channelLink}>
{content}
</Button>
);
if (children) {
return <Button navigate={channelLink}>{children}</Button>;
} else {
const Wrapper = addTooltip
? ({ children }) => (
<Tooltip label={<ClaimPreview uri={channelLink} type="tooltip" placeholder={false} />}>
{children}
</Tooltip>
)
: 'span';
return (
<Button className="button--uri-indicator" navigate={channelLink}>
<Wrapper>{inner}</Wrapper>
</Button>
);
}
} else {
return null;
}