Skip to content

Commit

Permalink
hotfix: render embeds in sites correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
horacioh committed May 13, 2024
1 parent 5b31b8f commit 904d35e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
16 changes: 8 additions & 8 deletions frontend/apps/site/src/site-embeds.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
}

Expand Down Expand Up @@ -191,12 +189,14 @@ function EmbedWrapper({
// overflow="hidden"
// borderRadius={layoutUnit / 4}
>
{props.children && viewType == 'content'}
<EmbedSideAnnotation
ref={sideannotationRef}
hmId={props.hmRef}
sidePos={sidePos}
/>
{props.children}
{viewType == 'content' ? (
<EmbedSideAnnotation
ref={sideannotationRef}
hmId={props.hmRef}
sidePos={sidePos}
/>
) : null}
</YStack>
</NextLink>
)
Expand Down
5 changes: 2 additions & 3 deletions frontend/packages/shared/src/publication-content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@ export function BlockNodeContent({
childrenType = 'group',
isFirstChild = false,
expanded = true,
embedDepth = 1,
parentBlockId,
...props
}: {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 904d35e

Please sign in to comment.