Created
May 1, 2025 04:28
-
-
Save whoisryosuke/d48090cdd184e17785d2921c9a1dbd5e to your computer and use it in GitHub Desktop.
React - Bluesky Embed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { PropsWithChildren } from "react"; | |
type Props = { | |
id: string; | |
userId: string; | |
}; | |
// <BlueskyEmbed id="3lmcux5cabv2i" userId="itayxaatwwlwww4fp3jac3nn" /> | |
const BlueskyEmbed = ({ id, userId, children }: PropsWithChildren<Props>) => { | |
const uri = `at://did:plc:${userId}/app.bsky.feed.post/${id}` | |
return ( | |
<div style={{ marginBottom: "3rem", display: "flex" justifyContent: "center"}}> | |
<blockquote | |
className="bluesky-embed" | |
data-bluesky-uri={uri} | |
data-bluesky-cid="bafyreiflt6p6c77vxtubpa4aev2qzilnkntxjbxx5x34x5yovs2afazyta" | |
data-bluesky-embed-color-mode="system" | |
> | |
{children} | |
</blockquote> | |
<script | |
async | |
src="https://embed.bsky.app/static/embed.js" | |
charSet="utf-8" | |
/> | |
</div> | |
); | |
}; | |
export default BlueskyEmbed; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment