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`.
This commit is contained in:
infinite-persistence 2021-07-29 15:53:56 +08:00
parent 9889c258e3
commit 4ff32e0c61
No known key found for this signature in database
GPG key ID: B9C3252EDC3D0AA0
2 changed files with 8 additions and 3 deletions

View file

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

View file

@ -53,7 +53,11 @@ function FileThumbnail(props: Props) {
const thumbnailUrl = url ? url.replace(/'/g, "\\'") : ''; const thumbnailUrl = url ? url.replace(/'/g, "\\'") : '';
if (hasResolvedClaim || thumbnailUrl) { if (hasResolvedClaim || thumbnailUrl) {
return <Thumb thumb={thumbnailUrl}>{children}</Thumb>; return (
<Thumb thumb={thumbnailUrl} className={className}>
{children}
</Thumb>
);
} }
return ( return (
<div <div