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> = ({
2929 } = ctx
3030 let coverContent = null
3131
32- const { page_cover_position = 0.5 } = block . format || { }
32+ const { page_cover_position = 0.5 , card_cover_position = 0.5 } = block . format || { }
3333 const coverPosition = ( 1 - page_cover_position ) * 100
34+ const cardCoverPosition = ( 1 - card_cover_position ) * 100
3435
3536 if ( cover ?. type === 'page_content' ) {
3637 const contentBlockId = block . content ?. find ( ( blockId ) => {
@@ -57,7 +58,8 @@ export const CollectionCard: React.FC<CollectionCardProps> = ({
5758 src = { src }
5859 alt = { caption || 'notion image' }
5960 style = { {
60- objectFit : coverAspect
61+ objectFit : coverAspect ,
62+ objectPosition : `center ${ cardCoverPosition } %`
6163 } }
6264 />
6365 )
You can’t perform that action at this time.
0 commit comments