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 {
126126}
127127
128128export 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 {
146129 properties : {
147130 source : string [ ] [ ]
148131 caption ?: Decoration [ ]
@@ -369,6 +352,7 @@ export interface GoogleDriveBlock extends BaseContentBlock {
369352 user_name : string
370353 modified_time : number
371354 }
355+ block_alignment : 'center' | 'left' | 'right'
372356 block_width : number
373357 block_height : number
374358 display_source : string
Original file line number Diff line number Diff line change 11import * as React from 'react'
2- import { BaseContentBlock , BaseImageBlock , Block } from 'notion-types'
2+ import { BaseContentBlock , Block } from 'notion-types'
33import { getTextContent } from 'notion-utils'
44
55import { useNotionContext } from '../context'
@@ -87,20 +87,18 @@ export const Asset: React.FC<{
8787 }
8888 }
8989 } 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
104102 }
105103 }
106104
You can’t perform that action at this time.
0 commit comments