File tree 3 files changed +7
-8
lines changed
packages/gitbook/src/components/DocumentView
3 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ export function Caption(
23
23
fit ?: boolean ;
24
24
wrapperStyle ?: ClassValue ;
25
25
block : DocumentBlockImage | DocumentBlockDrawing | DocumentBlockEmbed | DocumentBlockFile ;
26
+ withBorder ?: boolean ;
26
27
} & DocumentContextProps ,
27
28
) {
28
29
const {
@@ -31,15 +32,17 @@ export function Caption(
31
32
block,
32
33
context,
33
34
fit = false ,
35
+ withBorder = false ,
34
36
wrapperStyle = [
35
37
'relative' ,
36
38
'overflow-hidden' ,
37
39
'after:block' ,
38
40
'after:absolute' ,
39
41
'after:-inset-[0]' ,
40
- 'dark:after:mix-blend-plus-lighter' ,
41
- 'after:pointer-events-none' ,
42
42
fit ? 'w-fit' : null ,
43
+ withBorder
44
+ ? 'rounded straight-corners:rounded-none after:border-dark/2 after:border after:rounded straight-corners:after:rounded-none dark:after:border-light/1 dark:after:mix-blend-plus-lighter after:pointer-events-none'
45
+ : null ,
43
46
] ,
44
47
style,
45
48
} = props ;
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ export async function Embed(props: BlockProps<gitbookAPI.DocumentBlockEmbed>) {
22
22
: getEmbedByUrl ( block . data . url ) ) ;
23
23
24
24
return (
25
- < Caption { ...props } >
25
+ < Caption { ...props } withBorder >
26
26
{ embed . type === 'rich' ? (
27
27
< >
28
28
< div
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ export async function File(props: BlockProps<DocumentBlockFile>) {
21
21
const contentType = getSimplifiedContentType ( file . contentType ) ;
22
22
23
23
return (
24
- < Caption { ...props } wrapperStyle = { [ ] } >
24
+ < Caption { ...props } withBorder >
25
25
< Link
26
26
href = { file . downloadURL }
27
27
download = { file . name }
@@ -34,13 +34,9 @@ export async function File(props: BlockProps<DocumentBlockFile>) {
34
34
'flex' ,
35
35
'flex-row' ,
36
36
'items-center' ,
37
- 'border' ,
38
37
'px-5' ,
39
38
'py-3' ,
40
- 'border-dark/3' ,
41
- 'rounded-lg' ,
42
39
'hover:text-primary-600' ,
43
- 'dark:border-light/3' ,
44
40
'dark:hover:text-primary-300' ,
45
41
) }
46
42
>
You can’t perform that action at this time.
0 commit comments