prevent double navigation when clicking on fileTile thumbnails/titles

This commit is contained in:
Sean Yesmunt 2020-01-27 10:00:33 -05:00
parent 64a442e60d
commit 9544e29d29

View file

@ -53,8 +53,12 @@ function ClaimPreviewTile(props: Props) {
} = props;
const shouldFetch = claim === undefined;
const thumbnailUrl = useGetThumbnail(uri, claim, streamingUrl, getFile, placeholder) || thumbnail;
const navigateUrl = uri ? formatLbryUrlForWeb(uri) : undefined;
const claimsInChannel = (claim && claim.meta.claims_in_channel) || 0;
const navigateUrl = uri ? formatLbryUrlForWeb(uri) : undefined;
const navLinkProps = {
to: navigateUrl,
onClick: e => e.stopPropagation(),
};
let isChannel;
let isValid = false;
@ -142,10 +146,10 @@ function ClaimPreviewTile(props: Props) {
'claim-preview--channel': isChannel,
})}
>
<NavLink to={navigateUrl}>
<NavLink {...navLinkProps}>
<FileThumbnail thumbnail={thumbnailUrl} />
</NavLink>
<NavLink to={navigateUrl}>
<NavLink {...navLinkProps}>
<h2 className="claim-tile__title">
<TruncatedText text={title || (claim && claim.name)} lines={2} />
</h2>