From bd26d422fb818e576bfd290a6d4a08986b290221 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Sat, 1 Sep 2018 21:49:12 -0400 Subject: [PATCH] fix: inconsistent thumbnail size on the publish page --- .../component/selectThumbnail/view.jsx | 36 ++++++++++++------- src/renderer/scss/_gui.scss | 1 - src/renderer/scss/_vars.scss | 2 -- src/renderer/scss/component/_content.scss | 2 +- yarn.lock | 4 +-- 5 files changed, 27 insertions(+), 18 deletions(-) diff --git a/src/renderer/component/selectThumbnail/view.jsx b/src/renderer/component/selectThumbnail/view.jsx index a3dd3b208..a64d77a0e 100644 --- a/src/renderer/component/selectThumbnail/view.jsx +++ b/src/renderer/component/selectThumbnail/view.jsx @@ -55,22 +55,34 @@ class SelectThumbnail extends React.PureComponent { const thumbnailSrc = !thumbnail || thumbnailError ? Native.imagePath(thumbnailErrorImage) : thumbnail; + /* + Note: + We are using backgroundImage instead of an to zoom if the selected thumbnail isn't + the proper aspect ratio. This is to avoid blackbars on the side of images and inconsistent thumbnails + We still need to render the image to see if there is an error loading the url + */ + return (
{status === THUMBNAIL_STATUSES.API_DOWN || status === THUMBNAIL_STATUSES.MANUAL ? (
- {__('Thumbnail { - this.setState({ - thumbnailError: true, - thumbnailErrorImage: - thumbnail && thumbnail.length > 0 ? 'broken.png' : 'no-thumbnail.png', - }); - }} - /> +
+ {__('Thumbnail { + this.setState({ + thumbnailError: true, + thumbnailErrorImage: + thumbnail && thumbnail.length > 0 ? 'broken.png' : 'no-thumbnail.png', + }); + }} + /> +