From e567d964a7aff568ad063abb81b1ebc12d57d9d8 Mon Sep 17 00:00:00 2001 From: Caleb Date: Mon, 27 Aug 2018 13:51:47 -0600 Subject: [PATCH] chore: remove unused file from #1433 (#1661) --- .../MediaLibrary/MediaLibraryCardImage.js | 64 ------------------- 1 file changed, 64 deletions(-) delete mode 100644 packages/netlify-cms-core/src/components/MediaLibrary/MediaLibraryCardImage.js diff --git a/packages/netlify-cms-core/src/components/MediaLibrary/MediaLibraryCardImage.js b/packages/netlify-cms-core/src/components/MediaLibrary/MediaLibraryCardImage.js deleted file mode 100644 index ce1e9108..00000000 --- a/packages/netlify-cms-core/src/components/MediaLibrary/MediaLibraryCardImage.js +++ /dev/null @@ -1,64 +0,0 @@ -import React from 'react'; -import styled from 'react-emotion'; - -const CardImage = styled.img` - width: 100%; - height: 160px; - object-fit: cover; - border-radius: 2px 2px 0 0; -`; - -const CardImagePlaceholder = CardImage.withComponent(`div`); - -export default class MediaLibraryCardImage extends React.Component { - state = { - imageURL: '', - isFetching: false, - }; - - loadImage() { - const { image, getCachedImageURLByID, cacheImageURLByID } = this.props; - const { imageURL: existingImageURL, isFetching } = this.state; - - if (existingImageURL !== '' || isFetching) { - return; - } - - if (getCachedImageURLByID && image.key) { - const imageURL = getCachedImageURLByID(image.key); - if (imageURL) { - this.setState({ imageURL }); - return; - } - } - - if (image.url) { - this.setState({ imageURL: image.url }); - if (image.key && cacheImageURLByID) { - cacheImageURLByID(image.key, image.url); - } - return; - } - - if (image.getBlobPromise) { - this.setState({ isFetching: true }); - image.getBlobPromise().then(blob => { - const imageURL = window.URL.createObjectURL(blob); - this.setState({ imageURL, isFetching: false }); - if (image.key && cacheImageURLByID) { - cacheImageURLByID(image.key, imageURL); - } - }); - } - } - - render() { - const { imageURL, isFetching } = this.state; - - if (imageURL === '' && !isFetching) { - this.loadImage(); - } - - return imageURL === '' ? : ; - } -}