File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
packages/gitbook/src/components/DocumentView/Table Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -40,8 +40,8 @@ export async function RecordCard(
4040 const darkCoverIsSquareOrPortrait = isSquareOrPortrait ( darkCover ) ;
4141 const lightCoverIsSquareOrPortrait = isSquareOrPortrait ( lightCover ) ;
4242
43- const darkObjectFit = dark . objectFit ? `dark:${ getObjectFitClass ( dark . objectFit ) } ` : '' ;
44- const lightObjectFit = light . objectFit ? getObjectFitClass ( light . objectFit ) : '' ;
43+ const darkObjectFit = `dark:${ getObjectFitClass ( dark . objectFit ) } ` ;
44+ const lightObjectFit = getObjectFitClass ( light . objectFit ) ;
4545 const objectFits = `${ lightObjectFit } ${ darkObjectFit } ` ;
4646
4747 const body = (
@@ -204,7 +204,11 @@ function isSquareOrPortrait(contentRef: ResolvedContentRef | null) {
204204/**
205205 * Get the CSS class for object-fit based on the objectFit value.
206206 */
207- function getObjectFitClass ( objectFit : CardsImageObjectFit ) : string {
207+ function getObjectFitClass ( objectFit : CardsImageObjectFit | undefined ) : string {
208+ if ( ! objectFit ) {
209+ return 'object-cover' ;
210+ }
211+
208212 switch ( objectFit ) {
209213 case CardsImageObjectFit . Contain :
210214 return 'object-contain' ;
You can’t perform that action at this time.
0 commit comments