4ff32e0c61
## 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`.
25 lines
578 B
JavaScript
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;
|