Add nostr note and nevent embeds
Description
Adds nostr note and nevent embeds through the jump.me embed system, shoutout to @sfr0x for pointing out its existence!
Closes #1170
Screenshots
Additional Context
TODO
- I need to figure out the scrolling within an iframe issue as I am passing through the scrolling prop which is deprecated
- I have the height set to a fixed
485pxafter expansion but again needing to deal with scrolling because of this on long posts
Additional note: the duplicates catch for nevent posts are giving a bunch of false positives, but that can be for a future PR
Checklist
Are your changes backwards compatible? Please answer below:
Did you QA this? Could we deploy this straight to production? Please answer below:
For frontend changes: Tested on mobile? Please answer below:
Did you introduce any new environment variables? If so, call them out explicitly here:
Setting a dynamic height has proven more difficult than I anticipated using the https://njump.me/embed/$ script. It has logic for setting maxHeight to 50vh but since the src.setAttribute('height', px) logic is passed to the creation of iframe and not the created HTML I am not able to set something like height: max-content;. I ended up opting for a fixed 50dvh height using the https://njump.me/${nevent}?embed=yes direct iframe link and just have a small and expanded version that scrolls on notes larger than the height I set.
nostr embeds were added in https://github.com/stackernews/stacker.news/pull/1368