fix(media-library): no render of non-viewable files (#2546)
This commit is contained in:
parent
be7f443d6d
commit
4c5fe6a606
@ -55,7 +55,17 @@ const CardText = styled.p`
|
||||
|
||||
class MediaLibraryCard extends React.Component {
|
||||
render() {
|
||||
const { isSelected, displayURL, text, onClick, width, margin, isPrivate, type } = this.props;
|
||||
const {
|
||||
isSelected,
|
||||
displayURL,
|
||||
text,
|
||||
onClick,
|
||||
width,
|
||||
margin,
|
||||
isPrivate,
|
||||
type,
|
||||
isViewableImage,
|
||||
} = this.props;
|
||||
const url = displayURL.get('url');
|
||||
return (
|
||||
<Card
|
||||
@ -67,7 +77,7 @@ class MediaLibraryCard extends React.Component {
|
||||
isPrivate={isPrivate}
|
||||
>
|
||||
<CardImageWrapper>
|
||||
{url ? <CardImage src={url} /> : <CardFileIcon>{type}</CardFileIcon>}
|
||||
{url && isViewableImage ? <CardImage src={url} /> : <CardFileIcon>{type}</CardFileIcon>}
|
||||
</CardImageWrapper>
|
||||
<CardText>{text}</CardText>
|
||||
</Card>
|
||||
|
@ -52,6 +52,7 @@ const MediaLibraryCardGrid = ({
|
||||
displayURL={displayURLs.get(file.id, file.url ? Map({ url: file.url }) : Map())}
|
||||
loadDisplayURL={() => loadDisplayURL(file)}
|
||||
type={file.type}
|
||||
isViewableImage={file.isViewableImage}
|
||||
/>
|
||||
))}
|
||||
{!canLoadMore ? null : <Waypoint onEnter={onLoadMore} />}
|
||||
|
Loading…
x
Reference in New Issue
Block a user