File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
packages/react-notion-x/src/third-party Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -29,8 +29,9 @@ export const CollectionCard: React.FC<CollectionCardProps> = ({
29
29
} = ctx
30
30
let coverContent = null
31
31
32
- const { page_cover_position = 0.5 } = block . format || { }
32
+ const { page_cover_position = 0.5 , card_cover_position = 0.5 } = block . format || { }
33
33
const coverPosition = ( 1 - page_cover_position ) * 100
34
+ const cardCoverPosition = ( 1 - card_cover_position ) * 100
34
35
35
36
if ( cover ?. type === 'page_content' ) {
36
37
const contentBlockId = block . content ?. find ( ( blockId ) => {
@@ -57,7 +58,8 @@ export const CollectionCard: React.FC<CollectionCardProps> = ({
57
58
src = { src }
58
59
alt = { caption || 'notion image' }
59
60
style = { {
60
- objectFit : coverAspect
61
+ objectFit : coverAspect ,
62
+ objectPosition : `center ${ cardCoverPosition } %`
61
63
} }
62
64
/>
63
65
)
You can’t perform that action at this time.
0 commit comments