Skip to content

Commit

Permalink
Merge pull request #455 from ChanghyeonYoon/master
Browse files Browse the repository at this point in the history
  • Loading branch information
transitive-bullshit authored Nov 18, 2024
2 parents 7994181 + c0e8511 commit e3692b6
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/react-notion-x/src/block.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export function Block(props: BlockProps) {
disableHeader
} = props


if (!block) {
return null
}
Expand Down
4 changes: 4 additions & 0 deletions packages/react-notion-x/src/components/asset.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ export function Asset({

let source =
recordMap.signed_urls?.[block.id] || block.properties?.source?.[0]?.[0]

if (block.space_id) {
source = source.concat('&spaceId=', block.space_id)
}
let content = null

if (!source) {
Expand Down
6 changes: 5 additions & 1 deletion packages/react-notion-x/src/components/audio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@ export function Audio({
className?: string
}) {
const { recordMap } = useNotionContext()
const source =

let source =
recordMap.signed_urls[block.id] || block.properties?.source?.[0]?.[0]

if (block.space_id) {
source = source.concat('&spaceId=', block.space_id)
}
return (
<div className={cs('notion-audio', className)}>
<audio controls preload='none' src={source} />
Expand Down
7 changes: 6 additions & 1 deletion packages/react-notion-x/src/components/file.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,14 @@ export function File({
className?: string
}) {
const { components, recordMap } = useNotionContext()
const source =

let source =
recordMap.signed_urls[block.id] || block.properties?.source?.[0]?.[0]

if (block.space_id) {
source = source.concat('&spaceId=', block.space_id)
}

return (
<div className={cs('notion-file', className)}>
<components.Link
Expand Down

0 comments on commit e3692b6

Please sign in to comment.