Skip to content

Commit cc97699

Browse files
authored
Fix image frame width (#3765)
1 parent ebbb476 commit cc97699

File tree

1 file changed

+32
-24
lines changed
  • packages/gitbook/src/components/DocumentView

1 file changed

+32
-24
lines changed

packages/gitbook/src/components/DocumentView/Images.tsx

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,34 +19,42 @@ export function Images(props: BlockProps<DocumentBlockImages>) {
1919
className={tcls(
2020
style,
2121
'flex',
22-
'flex-row',
23-
'gap-3',
22+
'w-full',
2423
align === 'center' && 'justify-center',
2524
align === 'right' && 'justify-end',
26-
align === 'left' && 'justify-start',
27-
hasMultipleImages && ['grid', 'grid-flow-col'],
28-
withFrame && [
29-
'rounded-2xl',
30-
'border',
31-
'border-[rgb(234,235,238)]',
32-
'dark:border-[rgb(45,50,58)]',
33-
'relative',
34-
'overflow-hidden',
35-
]
25+
align === 'left' && 'justify-start'
3626
)}
3727
>
38-
{block.nodes.map((node: any, _i: number) => (
39-
<ImageBlock
40-
key={node.key}
41-
block={node}
42-
document={document}
43-
style={[]}
44-
siblings={block.nodes.length}
45-
context={context}
46-
isEstimatedOffscreen={isEstimatedOffscreen}
47-
withFrame={withFrame}
48-
/>
49-
))}
28+
<div
29+
className={tcls(
30+
'flex',
31+
'flex-row',
32+
'gap-3',
33+
hasMultipleImages && ['grid', 'grid-flow-col'],
34+
withFrame && [
35+
'rounded-2xl',
36+
'border',
37+
'border-[rgb(234,235,238)]',
38+
'dark:border-[rgb(45,50,58)]',
39+
'relative',
40+
'overflow-hidden',
41+
'w-fit',
42+
]
43+
)}
44+
>
45+
{block.nodes.map((node: any, _i: number) => (
46+
<ImageBlock
47+
key={node.key}
48+
block={node}
49+
document={document}
50+
style={[]}
51+
siblings={block.nodes.length}
52+
context={context}
53+
isEstimatedOffscreen={isEstimatedOffscreen}
54+
withFrame={withFrame}
55+
/>
56+
))}
57+
</div>
5058
</div>
5159
);
5260
}

0 commit comments

Comments
 (0)