Fix link moderation

This commit is contained in:
Eric Bailey
2025-03-16 15:52:52 -05:00
parent 9a8b2f9e3a
commit c959e11376
2 changed files with 53 additions and 4 deletions
+10
View File
@@ -234,6 +234,16 @@ export function LinkEmbed({
}) {
const {title, description, uri, thumb} = embed.view.external
if (!thumb) return null
const modui = rest.moderation.ui('contentMedia')
const info = getModerationCauseInfo({
cause: modui.blurs.at(0),
moderatorData: rest.moderatorData,
})
if (info) {
return <ModeratedEmbed info={info} />
}
const image = rest.data.images.get(thumb)
const player = parseEmbedPlayerFromUrl(uri)
const gif = rest.data.images.get(player?.playerUri)
+43 -4
View File
@@ -5,9 +5,12 @@
rel="stylesheet"
href="https://unpkg.com/svbstrate@5.1.0/svbstrate.css" />
<style>
img {
width: 100%;
}
img {
width: 100%;
}
h1, h2, h3, h4, h5, h6 {
margin: 1em 0 0.25rem;
}
</style>
</head>
<body class="p12">
@@ -41,9 +44,45 @@ img {
<h3>Feed</h3>
<img src="http://localhost:3000/profile/test-all-embeds-a.bsky.social/post/3lkchj6t27k2h?mat=1" />
<h3>Feed w/ label</h3>
<img src="http://localhost:3000/profile/test-all-embeds-a.bsky.social/post/3lkchjjmgx22h?mat=1" />
<img src="http://localhost:3000/profile/test-all-embeds-a.bsky.social/post/3lkjid3khps2r?mat=1" />
<h3>Link</h3>
<img src="http://localhost:3000/profile/test-all-embeds-a.bsky.social/post/3lkchlshes22h?mat=1" />
<h3>Link w/ label</h3>
<img src="http://localhost:3000/profile/test-all-embeds-a.bsky.social/post/3lkchm7qo622h?mat=1" />
<h3>Starter pack</h3>
<img src="http://localhost:3000/profile/test-all-embeds-a.bsky.social/post/3lkchnlwlbs2h?mat=1" />
<h1>Quote posts</h1>
<h3>Image</h3>
<img src="http://localhost:3000/profile/test-all-embeds-a.bsky.social/post/3lkchp7oaq22h?mat=1" />
<h3>Image w/ label</h3>
<img src="http://localhost:3000/profile/test-all-embeds-a.bsky.social/post/3lkchpijwu22h?mat=1" />
<h3>Video</h3>
<img src="http://localhost:3000/profile/test-all-embeds-a.bsky.social/post/3lkchpvu6is2h?mat=1" />
<h3>Video w/ label</h3>
<img src="http://localhost:3000/profile/test-all-embeds-a.bsky.social/post/3lkchq5dfrk2h?mat=1" />
<h3>GIF</h3>
<img src="http://localhost:3000/profile/test-all-embeds-a.bsky.social/post/3lkjip5qduk2l?mat=1" />
<h3>List</h3>
<img src="http://localhost:3000/profile/test-all-embeds-a.bsky.social/post/3lkchqdm3nk2h?mat=1" />
<h3>List (takendown)</h3>
<img src="http://localhost:3000/profile/test-all-embeds-a.bsky.social/post/3lkchqmp2722h?mat=1" />
<h3>Feed</h3>
<img src="http://localhost:3000/profile/test-all-embeds-a.bsky.social/post/3lkchqrrigs2h?mat=1" />
<h3>Link</h3>
<img src="http://localhost:3000/profile/test-all-embeds-a.bsky.social/post/3lkchqyf6u22h?mat=1" />
<h3>Link w/ label</h3>
<img src="http://localhost:3000/profile/test-all-embeds-a.bsky.social/post/3lkchremdhc2h?mat=1" />
<h3>Starter pack</h3>
<img src="http://localhost:3000/profile/test-all-embeds-a.bsky.social/post/3lkchrlw4vk2h?mat=1" />
<h1>Quote post states</h1>
<h3>Deleted</h3>
<img src="http://localhost:3000/profile/test-all-embeds-a.bsky.social/post/3lkcieaeil22a?mat=1" />
<h3>Detached quoted post</h3>
<img src="http://localhost:3000/profile/test-all-embeds-a.bsky.social/post/3lkciefiepk2a?mat=1" />
<h3>Blocked</h3>
<img src="http://localhost:3000/profile/test-all-embeds-a.bsky.social/post/3lkcikkheys2c?mat=1" />
</div>
</body>
</html>