@@ -28,9 +28,9 @@ export async function RecordCard(
28
28
: null ;
29
29
const target = targetRef ? await context . resolveContentRef ( targetRef ) : null ;
30
30
31
- const coverIsLandscape =
31
+ const coverIsSquareOrPortrait =
32
32
cover ?. file ?. dimensions &&
33
- cover . file ?. dimensions ?. width / cover . file ?. dimensions ?. height > 1 ;
33
+ cover . file ?. dimensions ?. width / cover . file ?. dimensions ?. height <= 1 ;
34
34
35
35
const body = (
36
36
< div
@@ -54,15 +54,13 @@ export async function RecordCard(
54
54
// On mobile, check if we can display the cover responsively or not:
55
55
// - If the file has a landscape aspect ratio, we display it normally
56
56
// - If the file is square or portrait, we display it left with 40% of the card width
57
- cover
58
- ? coverIsLandscape
59
- ? 'grid-rows-[auto,1fr]'
60
- : [
61
- 'grid-cols-[40%,_1fr]' ,
62
- 'min-[432px]:grid-cols-none' ,
63
- 'min-[432px]:grid-rows-[auto,1fr]' ,
64
- ]
65
- : null ,
57
+ coverIsSquareOrPortrait
58
+ ? [
59
+ 'grid-cols-[40%,_1fr]' ,
60
+ 'min-[432px]:grid-cols-none' ,
61
+ 'min-[432px]:grid-rows-[auto,1fr]' ,
62
+ ]
63
+ : 'grid-rows-[auto,1fr]' ,
66
64
) }
67
65
>
68
66
{ cover ? (
@@ -84,9 +82,9 @@ export async function RecordCard(
84
82
'w-full' ,
85
83
'h-full' ,
86
84
'object-cover' ,
87
- coverIsLandscape
88
- ? [ 'h-auto' , 'aspect-video' ]
89
- : [ 'min-[432px]: h-auto' , 'min-[432px]: aspect-video' ] ,
85
+ coverIsSquareOrPortrait
86
+ ? [ 'min-[432px]: h-auto' , 'min-[432px]: aspect-video' ]
87
+ : [ 'h-auto' , 'aspect-video' ] ,
90
88
) }
91
89
priority = { isOffscreen ? 'lazy' : 'high' }
92
90
preload
0 commit comments