File tree 3 files changed +11
-7
lines changed
3 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -247,7 +247,11 @@ export const Block: React.FC<Block> = props => {
247
247
return (
248
248
< figure
249
249
className = "notion-asset-wrapper"
250
- style = { { width : value . format . block_width } }
250
+ style = {
251
+ value . format !== undefined
252
+ ? { width : value . format . block_width }
253
+ : undefined
254
+ }
251
255
>
252
256
< Asset block = { block } mapImageUrl = { mapImageUrl } />
253
257
Original file line number Diff line number Diff line change @@ -16,11 +16,11 @@ const Asset: React.FC<{
16
16
17
17
const format = value . format ;
18
18
const {
19
- display_source,
20
- block_aspect_ratio,
21
- block_height,
22
- block_width
23
- } = format ;
19
+ display_source = undefined ,
20
+ block_aspect_ratio = undefined ,
21
+ block_height = 1 ,
22
+ block_width = 1
23
+ } = format ?? { } ;
24
24
25
25
const aspectRatio = block_aspect_ratio || block_height / block_width ;
26
26
Original file line number Diff line number Diff line change @@ -196,7 +196,7 @@ export interface ContentValueType extends BaseValueType {
196
196
source : string [ ] [ ] ;
197
197
caption ?: DecorationType [ ] ;
198
198
} ;
199
- format : {
199
+ format ? : {
200
200
block_width : number ;
201
201
block_height : number ;
202
202
display_source : string ;
You can’t perform that action at this time.
0 commit comments