Skip to content

Commit 9f30af1

Browse files
authored
Fix card layout for cards without cover (#2831)
1 parent ff05e20 commit 9f30af1

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

packages/gitbook/src/components/DocumentView/Table/RecordCard.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,15 @@ export async function RecordCard(
5454
// On mobile, check if we can display the cover responsively or not:
5555
// - If the file has a landscape aspect ratio, we display it normally
5656
// - If the file is square or portrait, we display it left with 40% of the card width
57-
coverIsLandscape
58-
? 'grid-rows-[auto,1fr]'
59-
: [
60-
'grid-cols-[40%,_1fr]',
61-
'min-[432px]:grid-cols-none',
62-
'min-[432px]:grid-rows-[auto,1fr]',
63-
],
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,
6466
)}
6567
>
6668
{cover ? (

0 commit comments

Comments
 (0)