From 904d35ec83b8ad5a88c0e0afb17b43813e73b545 Mon Sep 17 00:00:00 2001 From: Horacio Herrera Date: Mon, 13 May 2024 15:37:27 +0200 Subject: [PATCH] hotfix: render embeds in sites correctly --- frontend/apps/site/src/site-embeds.tsx | 16 ++++++++-------- .../packages/shared/src/publication-content.tsx | 5 ++--- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/frontend/apps/site/src/site-embeds.tsx b/frontend/apps/site/src/site-embeds.tsx index 3591a34cf..33b6b7c13 100644 --- a/frontend/apps/site/src/site-embeds.tsx +++ b/frontend/apps/site/src/site-embeds.tsx @@ -135,13 +135,11 @@ function EmbedWrapper({ if (wrapperRef.current) { observeSize(wrapperRef.current, (rect) => { wrapperRect.current = rect - console.log('OBSERVER', wrapperRect.current) }) } if (sideannotationRef.current) { observeSize(sideannotationRef.current, (rect) => { sideRect.current = rect - console.log('OBSERVER SIDE', sideRect.current) }) } @@ -191,12 +189,14 @@ function EmbedWrapper({ // overflow="hidden" // borderRadius={layoutUnit / 4} > - {props.children && viewType == 'content'} - + {props.children} + {viewType == 'content' ? ( + + ) : null} ) diff --git a/frontend/packages/shared/src/publication-content.tsx b/frontend/packages/shared/src/publication-content.tsx index c1274053b..c04d4fd99 100644 --- a/frontend/packages/shared/src/publication-content.tsx +++ b/frontend/packages/shared/src/publication-content.tsx @@ -452,6 +452,7 @@ export function BlockNodeContent({ childrenType = 'group', isFirstChild = false, expanded = true, + embedDepth = 1, parentBlockId, ...props }: { @@ -504,9 +505,7 @@ export function BlockNodeContent({ start={blockNode.block?.attributes?.start} index={index} parentBlockId={blockNode.block?.id || null} - embedDepth={ - props.embedDepth ? props.embedDepth + 1 : props.embedDepth - } + embedDepth={embedDepth ? embedDepth + 1 : embedDepth} /> )) : null