File tree Expand file tree Collapse file tree 3 files changed +11
-7
lines changed Expand file tree Collapse file tree 3 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -246,7 +246,11 @@ export const Block: React.FC<Block> = props => {
246246 return (
247247 < figure
248248 className = "notion-asset-wrapper"
249- style = { { width : value . format . block_width } }
249+ style = {
250+ value . format !== undefined
251+ ? { width : value . format . block_width }
252+ : undefined
253+ }
250254 >
251255 < Asset block = { block } mapImageUrl = { mapImageUrl } />
252256
Original file line number Diff line number Diff line change @@ -16,11 +16,11 @@ const Asset: React.FC<{
1616
1717 const format = value . format ;
1818 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 ?? { } ;
2424
2525 const aspectRatio = block_aspect_ratio || block_height / block_width ;
2626
Original file line number Diff line number Diff line change @@ -196,7 +196,7 @@ export interface ContentValueType extends BaseValueType {
196196 source : string [ ] [ ] ;
197197 caption ?: DecorationType [ ] ;
198198 } ;
199- format : {
199+ format ? : {
200200 block_width : number ;
201201 block_height : number ;
202202 display_source : string ;
You can’t perform that action at this time.
0 commit comments