Added Download Button on hover for the thumbnail
This commit is contained in:
parent
8e16b8d8ab
commit
3f9953c41b
1 changed files with 14 additions and 0 deletions
|
@ -13,6 +13,8 @@ import { formatLbryUrlForWeb } from 'util/url';
|
|||
import { parseURI } from 'lbry-redux';
|
||||
import FileProperties from 'component/fileProperties';
|
||||
|
||||
import FileDownloadLink from 'component/fileDownloadLink';
|
||||
|
||||
type Props = {
|
||||
uri: string,
|
||||
claim: ?Claim,
|
||||
|
@ -61,6 +63,8 @@ function ClaimPreviewTile(props: Props) {
|
|||
onClick: e => e.stopPropagation(),
|
||||
};
|
||||
|
||||
const [isHovering, setHovering] = React.useState(false);
|
||||
|
||||
let isChannel;
|
||||
let isValid = false;
|
||||
if (uri) {
|
||||
|
@ -87,6 +91,14 @@ function ClaimPreviewTile(props: Props) {
|
|||
}
|
||||
}
|
||||
|
||||
function handleOnMouseOver(e) {
|
||||
setHovering(true);
|
||||
}
|
||||
|
||||
function handleOnMouseOut(e) {
|
||||
setHovering(false);
|
||||
}
|
||||
|
||||
React.useEffect(() => {
|
||||
if (isValid && !isResolvingUri && shouldFetch && uri) {
|
||||
resolveUri(uri);
|
||||
|
@ -146,6 +158,8 @@ function ClaimPreviewTile(props: Props) {
|
|||
className={classnames('card claim-preview--tile', {
|
||||
'claim-preview--channel': isChannel,
|
||||
})}
|
||||
onMouseOver={handleOnMouseOver}
|
||||
onMouseOut={handleOnMouseOut}
|
||||
>
|
||||
<NavLink {...navLinkProps}>
|
||||
<FileThumbnail thumbnail={thumbnailUrl}>
|
||||
|
|
Loading…
Add table
Reference in a new issue