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 {
|
class MediaLibraryCard extends React.Component {
|
||||||
render() {
|
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');
|
const url = displayURL.get('url');
|
||||||
return (
|
return (
|
||||||
<Card
|
<Card
|
||||||
@ -67,7 +77,7 @@ class MediaLibraryCard extends React.Component {
|
|||||||
isPrivate={isPrivate}
|
isPrivate={isPrivate}
|
||||||
>
|
>
|
||||||
<CardImageWrapper>
|
<CardImageWrapper>
|
||||||
{url ? <CardImage src={url} /> : <CardFileIcon>{type}</CardFileIcon>}
|
{url && isViewableImage ? <CardImage src={url} /> : <CardFileIcon>{type}</CardFileIcon>}
|
||||||
</CardImageWrapper>
|
</CardImageWrapper>
|
||||||
<CardText>{text}</CardText>
|
<CardText>{text}</CardText>
|
||||||
</Card>
|
</Card>
|
||||||
|
@ -52,6 +52,7 @@ const MediaLibraryCardGrid = ({
|
|||||||
displayURL={displayURLs.get(file.id, file.url ? Map({ url: file.url }) : Map())}
|
displayURL={displayURLs.get(file.id, file.url ? Map({ url: file.url }) : Map())}
|
||||||
loadDisplayURL={() => loadDisplayURL(file)}
|
loadDisplayURL={() => loadDisplayURL(file)}
|
||||||
type={file.type}
|
type={file.type}
|
||||||
|
isViewableImage={file.isViewableImage}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
{!canLoadMore ? null : <Waypoint onEnter={onLoadMore} />}
|
{!canLoadMore ? null : <Waypoint onEnter={onLoadMore} />}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user