Fixes the styling for custom-wrapped components
This commit is contained in:
parent
1173171084
commit
fb868a5810
1 changed files with 16 additions and 12 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue