From e94d4bcd2884153ec88355a8f189de29eb9db082 Mon Sep 17 00:00:00 2001 From: jessopb <36554050+jessopb@users.noreply.github.com> Date: Wed, 13 Jan 2021 10:44:44 -0500 Subject: [PATCH] repost ui (#5293) --- ui/component/claimPreview/view.jsx | 43 ++++++++++++++----------- ui/component/claimRepostAuthor/view.jsx | 23 +++++++++---- ui/redux/selectors/search.js | 4 ++- 3 files changed, 45 insertions(+), 25 deletions(-) diff --git a/ui/component/claimPreview/view.jsx b/ui/component/claimPreview/view.jsx index c0de60576..6cd4baabf 100644 --- a/ui/component/claimPreview/view.jsx +++ b/ui/component/claimPreview/view.jsx @@ -131,9 +131,10 @@ const ClaimPreview = forwardRef((props: Props, ref: any) => { isValid = false; } } + const isRepost = claim && claim.repost_url; - const contentUri = hideRepostLabel && claim && claim.repost_url ? claim.canonical_url || claim.permanent_url : uri; - const isChannel = isValid ? parseURI(contentUri).isChannel : false; + const contentUri = claim && isRepost ? claim.canonical_url || claim.permanent_url : uri; + const isChannelUri = isValid ? parseURI(contentUri).isChannel : false; const signingChannel = claim && claim.signing_channel; const navigateUrl = formatLbryUrlForWeb((claim && claim.canonical_url) || uri || '/'); const navLinkProps = { @@ -170,7 +171,7 @@ const ClaimPreview = forwardRef((props: Props, ref: any) => { } // block channel claims if we can't control for them in claim search // e.g. fetchRecommendedSubscriptions - if (claim && isChannel && !shouldHide && !showUserBlocked && blockedChannelUris.length) { + if (claim && isChannelUri && !shouldHide && !showUserBlocked && blockedChannelUris.length) { shouldHide = blockedChannelUris.some(blockedUri => blockedUri === claim.permanent_url); } @@ -216,21 +217,25 @@ const ClaimPreview = forwardRef((props: Props, ref: any) => { } if (placeholder === 'loading' || (uri && !claim && isResolvingUri)) { - return ; + return ; } if (claim && showNullPlaceholder && shouldHide && nsfw) { return ( -