Simplify some props

This commit is contained in:
Eric Bailey
2026-06-08 10:39:52 -05:00
parent 28bd708c6b
commit a95da2d6da
8 changed files with 19 additions and 25 deletions
+3 -4
View File
@@ -46,11 +46,10 @@ export function ImageEmbed({
const layout: 'single' | 'grid' | 'carousel' = const layout: 'single' | 'grid' | 'carousel' =
images.length === 1 ? 'single' : useExpandedLayout ? 'carousel' : 'grid' images.length === 1 ? 'single' : useExpandedLayout ? 'carousel' : 'grid'
const postContext = const postContext = rest.post
rest.uri && rest.authorDid
? { ? {
uri: rest.uri, uri: rest.post.uri,
authorDid: rest.authorDid, authorDid: rest.post.author.did,
feedDescriptor: rest.feedDescriptor, feedDescriptor: rest.feedDescriptor,
} }
: undefined : undefined
+1 -2
View File
@@ -347,8 +347,7 @@ export function QuoteEmbed({
} }
// The photo embed belongs to the quoted post, so attribute its // The photo embed belongs to the quoted post, so attribute its
// analytics to the quoted post rather than the parent. // analytics to the quoted post rather than the parent.
uri={quote.uri} post={quote}
authorDid={quote.author.did}
/> />
)} )}
</> </>
+6 -5
View File
@@ -15,11 +15,12 @@ export type CommonProps = {
viewContext?: PostEmbedViewContext viewContext?: PostEmbedViewContext
isWithinQuote?: boolean isWithinQuote?: boolean
allowNestedQuotes?: boolean allowNestedQuotes?: boolean
// Post context for analytics on photo embed events (post:photoEmbed:*). /**
// When the embed has no owning post (e.g. previews), leave these undefined * The post that contains this embed. Used for analytics on photo embed
// and no events will be emitted. * events (post:photoEmbed:*). When the embed has no owning post (e.g.
uri?: string * composer previews), leave this undefined and no events will be emitted.
authorDid?: string */
post?: AppBskyFeedDefs.PostView
feedDescriptor?: string feedDescriptor?: string
} }
@@ -414,8 +414,7 @@ const ThreadItemAnchorInner = memo(function ThreadItemAnchorInner({
moderation={moderation} moderation={moderation}
viewContext={PostEmbedViewContext.ThreadHighlighted} viewContext={PostEmbedViewContext.ThreadHighlighted}
onOpen={onOpenEmbed} onOpen={onOpenEmbed}
uri={post.uri} post={post}
authorDid={post.author.did}
/> />
</View> </View>
)} )}
@@ -349,8 +349,7 @@ const ThreadItemPostInner = memo(function ThreadItemPostInner({
embed={post.embed} embed={post.embed}
moderation={moderation} moderation={moderation}
viewContext={PostEmbedViewContext.Feed} viewContext={PostEmbedViewContext.Feed}
uri={post.uri} post={post}
authorDid={post.author.did}
/> />
</View> </View>
)} )}
@@ -371,8 +371,7 @@ const ThreadItemTreePostInner = memo(function ThreadItemTreePostInner({
embed={post.embed} embed={post.embed}
moderation={moderation} moderation={moderation}
viewContext={PostEmbedViewContext.Feed} viewContext={PostEmbedViewContext.Feed}
uri={post.uri} post={post}
authorDid={post.author.did}
/> />
</View> </View>
)} )}
+1 -2
View File
@@ -255,8 +255,7 @@ function PostInner({
embed={post.embed} embed={post.embed}
moderation={moderation} moderation={moderation}
viewContext={PostEmbedViewContext.Feed} viewContext={PostEmbedViewContext.Feed}
uri={post.uri} post={post}
authorDid={post.author.did}
/> />
</View> </View>
) : null} ) : null}
+1 -2
View File
@@ -531,8 +531,7 @@ let PostContent = ({
moderation={moderation} moderation={moderation}
onOpen={onOpenEmbed} onOpen={onOpenEmbed}
viewContext={PostEmbedViewContext.Feed} viewContext={PostEmbedViewContext.Feed}
uri={post.uri} post={post}
authorDid={post.author.did}
feedDescriptor={feedDescriptor} feedDescriptor={feedDescriptor}
/> />
</View> </View>