File tree Expand file tree Collapse file tree 2 files changed +14
-32
lines changed
react-notion-x/src/components Expand file tree Collapse file tree 2 files changed +14
-32
lines changed Original file line number Diff line number Diff line change @@ -126,23 +126,6 @@ export interface BaseTextBlock extends BaseBlock {
126
126
}
127
127
128
128
export interface BaseContentBlock extends BaseBlock {
129
- properties : {
130
- source : string [ ] [ ]
131
- caption ?: Decoration [ ]
132
- }
133
- format ?: {
134
- block_width : number
135
- block_height : number
136
- display_source : string
137
- block_full_width : boolean
138
- block_page_width : boolean
139
- block_aspect_ratio : number
140
- block_preserve_scale : boolean
141
- }
142
- file_ids ?: string [ ]
143
- }
144
-
145
- export interface BaseImageBlock extends BaseContentBlock {
146
129
properties : {
147
130
source : string [ ] [ ]
148
131
caption ?: Decoration [ ]
@@ -369,6 +352,7 @@ export interface GoogleDriveBlock extends BaseContentBlock {
369
352
user_name : string
370
353
modified_time : number
371
354
}
355
+ block_alignment : 'center' | 'left' | 'right'
372
356
block_width : number
373
357
block_height : number
374
358
display_source : string
Original file line number Diff line number Diff line change 1
1
import * as React from 'react'
2
- import { BaseContentBlock , BaseImageBlock , Block } from 'notion-types'
2
+ import { BaseContentBlock , Block } from 'notion-types'
3
3
import { getTextContent } from 'notion-utils'
4
4
5
5
import { useNotionContext } from '../context'
@@ -87,20 +87,18 @@ export const Asset: React.FC<{
87
87
}
88
88
}
89
89
} else {
90
- if ( block . type == 'image' ) {
91
- switch ( ( block as BaseImageBlock ) . format ?. block_alignment ) {
92
- case 'center' : {
93
- style . alignSelf = 'center'
94
- break
95
- }
96
- case 'left' : {
97
- style . alignSelf = 'start'
98
- break
99
- }
100
- case 'right' : {
101
- style . alignSelf = 'end'
102
- break
103
- }
90
+ switch ( block . format ?. block_alignment ) {
91
+ case 'center' : {
92
+ style . alignSelf = 'center'
93
+ break
94
+ }
95
+ case 'left' : {
96
+ style . alignSelf = 'start'
97
+ break
98
+ }
99
+ case 'right' : {
100
+ style . alignSelf = 'end'
101
+ break
104
102
}
105
103
}
106
104
You can’t perform that action at this time.
0 commit comments