mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-29 04:38:55 +03:00
Not all cards work in large size
Check the image aspect ratio before converting to large size
This commit is contained in:
parent
808d56432e
commit
160b535552
1 changed files with 2 additions and 1 deletions
|
@ -861,7 +861,8 @@ function Card({ card, size }) {
|
|||
*/
|
||||
|
||||
const hasText = title || providerName || authorName;
|
||||
size = size === 'l' ? 'large' : '';
|
||||
const isLandscape = width / height >= 1.2;
|
||||
size = size === 'l' && isLandscape ? 'large' : '';
|
||||
|
||||
if (hasText && image) {
|
||||
const domain = new URL(url).hostname.replace(/^www\./, '');
|
||||
|
|
Loading…
Reference in a new issue