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;
|
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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue