lbry-desktop/ui/component/fileThumbnail/thumb.jsx
infinite-persistence 4ff32e0c61
Fix missing file-thumbnail in Notifications
## Issue
6721 Notifications: Thumbnail for "new content" not showing up in Desktop layout

## Change
The `className` wasn't propagated during the `FileThumbnail` refactoring to `Thumbs`.
2021-07-29 15:56:42 +08:00

25 lines
578 B
JavaScript

// @flow
import React from 'react';
import classnames from 'classnames';
import type { Node } from 'react';
import useLazyLoading from 'effects/use-lazy-loading';
type Props = {
thumb: string,
children?: Node,
className?: string,
};
const Thumb = (props: Props) => {
const { thumb, children, className } = props;
const thumbnailRef = React.useRef(null);
useLazyLoading(thumbnailRef);
return (
<div ref={thumbnailRef} data-background-image={thumb} className={classnames('media__thumb', className)}>
{children}
</div>
);
};
export default Thumb;