minor fixes for channel tooltip

This commit is contained in:
btzr-io 2019-06-05 00:30:41 -06:00
parent 3dcdf913cf
commit f4b099f69e

View file

@ -120,8 +120,7 @@ class ChannelLink extends React.Component<Props, State> {
const { channelName, claimName, claimId } = parseURI(uri); const { channelName, claimName, claimId } = parseURI(uri);
const blackListed = this.isClaimBlackListed(); const blackListed = this.isClaimBlackListed();
const isReady = !blackListed && !isResolvingUri && claim !== null; const isReady = !blackListed && !isResolvingUri && claim !== null;
const tooltipReady = isReady && this.buttonRef.current !== null; const tooltipReady = this.buttonRef.current !== null;
const bgColor = '#32373b'; const bgColor = '#32373b';
const tooltipStyle = { const tooltipStyle = {
@ -129,10 +128,10 @@ class ChannelLink extends React.Component<Props, State> {
arrowStyle: { color: bgColor }, arrowStyle: { color: bgColor },
}; };
return isReady ? ( return (
<React.Fragment> <React.Fragment>
<Button <Button
button="link" button={'link'}
label={children} label={children}
navigate={uri} navigate={uri}
innerRef={this.buttonRef} innerRef={this.buttonRef}
@ -149,13 +148,11 @@ class ChannelLink extends React.Component<Props, State> {
channelName={channelName} channelName={channelName}
thumbnail={thumbnail} thumbnail={thumbnail}
description={description} description={description}
active={this.state.isTooltipActive} active={isReady && this.state.isTooltipActive}
parent={this.buttonRef.current} parent={this.buttonRef.current}
/> />
)} )}
</React.Fragment> </React.Fragment>
) : (
<span>{children}</span>
); );
} }
} }