Skip to content

Commit 28e3159

Browse files
authored
Update asset.tsx
1 parent b2100f0 commit 28e3159

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

src/components/asset.tsx

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const Asset: React.FC<{
2424

2525
const aspectRatio = block_aspect_ratio || block_height / block_width;
2626

27-
if (type === "figma") {
27+
if (type === "embed" || type === "video" || type === "figma") {
2828
return (
2929
<div
3030
style={{
@@ -34,25 +34,12 @@ const Asset: React.FC<{
3434
>
3535
<iframe
3636
className="notion-image-inset"
37-
src={value.properties.source[0][0]}
37+
src={type === "figma" ? value.properties.source[0][0] : display_source}
3838
/>
3939
</div>
4040
);
4141
}
4242

43-
if (type === "embed" || type === "video") {
44-
return (
45-
<div
46-
style={{
47-
paddingBottom: `${aspectRatio * 100}%`,
48-
position: "relative"
49-
}}
50-
>
51-
<iframe className="notion-image-inset" src={display_source} />
52-
</div>
53-
);
54-
}
55-
5643
const src = mapImageUrl(value.properties.source[0][0]);
5744

5845
if (type === "image") {

0 commit comments

Comments
 (0)