fix: inconsistent thumbnail size on the publish page
This commit is contained in:
parent
fb3097a739
commit
bd26d422fb
5 changed files with 27 additions and 18 deletions
|
@ -55,13 +55,24 @@ class SelectThumbnail extends React.PureComponent<Props, State> {
|
||||||
const thumbnailSrc =
|
const thumbnailSrc =
|
||||||
!thumbnail || thumbnailError ? Native.imagePath(thumbnailErrorImage) : thumbnail;
|
!thumbnail || thumbnailError ? Native.imagePath(thumbnailErrorImage) : thumbnail;
|
||||||
|
|
||||||
|
/*
|
||||||
|
Note:
|
||||||
|
We are using backgroundImage instead of an <img /> 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 (
|
return (
|
||||||
<div className="card__content">
|
<div className="card__content">
|
||||||
{status === THUMBNAIL_STATUSES.API_DOWN || status === THUMBNAIL_STATUSES.MANUAL ? (
|
{status === THUMBNAIL_STATUSES.API_DOWN || status === THUMBNAIL_STATUSES.MANUAL ? (
|
||||||
<div className="column">
|
<div className="column">
|
||||||
|
<div
|
||||||
|
className="column__item thumbnail-preview card__media"
|
||||||
|
style={{ backgroundImage: `url(${thumbnailSrc})` }}
|
||||||
|
>
|
||||||
<img
|
<img
|
||||||
|
style={{ display: 'none' }}
|
||||||
src={thumbnailSrc}
|
src={thumbnailSrc}
|
||||||
className="column__item thumbnail-preview"
|
|
||||||
alt={__('Thumbnail Preview')}
|
alt={__('Thumbnail Preview')}
|
||||||
onError={() => {
|
onError={() => {
|
||||||
this.setState({
|
this.setState({
|
||||||
|
@ -71,6 +82,7 @@ class SelectThumbnail extends React.PureComponent<Props, State> {
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
<div className="column__item">
|
<div className="column__item">
|
||||||
<FormField
|
<FormField
|
||||||
className="input--thumbnail"
|
className="input--thumbnail"
|
||||||
|
|
|
@ -389,5 +389,4 @@ p {
|
||||||
.thumbnail-preview {
|
.thumbnail-preview {
|
||||||
height: var(--thumbnail-preview-height);
|
height: var(--thumbnail-preview-height);
|
||||||
width: var(--thumbnail-preview-width);
|
width: var(--thumbnail-preview-width);
|
||||||
border: var(--thumbnail-preview-border);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -195,6 +195,4 @@ $large-breakpoint: 1921px;
|
||||||
/* Image */
|
/* Image */
|
||||||
--thumbnail-preview-height: 100px;
|
--thumbnail-preview-height: 100px;
|
||||||
--thumbnail-preview-width: 177px;
|
--thumbnail-preview-width: 177px;
|
||||||
// This will awlways white, it looks fine on light mode
|
|
||||||
--thumbnail-preview-border: 1px solid var(--color-white);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
background-size: cover;
|
background-size: contain;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-position: 50% 50%;
|
background-position: 50% 50%;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
|
@ -5655,9 +5655,9 @@ lazy-val@^1.0.3:
|
||||||
version "1.0.3"
|
version "1.0.3"
|
||||||
resolved "https://registry.yarnpkg.com/lazy-val/-/lazy-val-1.0.3.tgz#bb97b200ef00801d94c317e29dc6ed39e31c5edc"
|
resolved "https://registry.yarnpkg.com/lazy-val/-/lazy-val-1.0.3.tgz#bb97b200ef00801d94c317e29dc6ed39e31c5edc"
|
||||||
|
|
||||||
lbry-redux@lbryio/lbry-redux#eae0d134d92d83f733b85a8ecebf529a6e9799cf:
|
lbry-redux@lbryio/lbry-redux#421321a78397251589e5a890f4caa95e79975e2b:
|
||||||
version "0.0.1"
|
version "0.0.1"
|
||||||
resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/eae0d134d92d83f733b85a8ecebf529a6e9799cf"
|
resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/421321a78397251589e5a890f4caa95e79975e2b"
|
||||||
dependencies:
|
dependencies:
|
||||||
proxy-polyfill "0.1.6"
|
proxy-polyfill "0.1.6"
|
||||||
reselect "^3.0.0"
|
reselect "^3.0.0"
|
||||||
|
|
Loading…
Add table
Reference in a new issue