-
Notifications
You must be signed in to change notification settings - Fork 161
Add support for Figma Embed Link #28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
I've already added support for a variety of embeds including figma in my fork, but for now I think we should merge this.
Here's a public notion page I created for testing different types of embeds: https://www.notion.so/saasifysh/Embeds-5d4e290ca4604d8fb809af806a6c1749
src/components/asset.tsx
Outdated
> | ||
<iframe | ||
className="notion-image-inset" | ||
src={value.properties.source[0][0]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we move this into (type === "embed" || type === "video")
and add || type === "figma"
and then:
<iframe
className="notion-image-inset"
src={type === "figma" ? value.properties.source[0][0] : display_source}
/>
we can also improve the if with
["embed","video","figma"].includes(type)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
src/components/asset.tsx
Outdated
> | ||
<iframe | ||
className="notion-image-inset" | ||
src={value.properties.source[0][0]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure!
Hi! First, this lib rocks! 🚀
Second, I'm building my blog and realized some embed link were'nt supported yet. My plan was to send a PR for codepen, tweet and other assets, but only figma has
block.format.block_height
andwidth
to calculate the aspect ratio.This PR adds support for Figma embed links.
Screenshot of it: