moderate avatars and embeds in composer reply to (#2665)

* moderate avatars and embeds in composer reply to

* oops

* dont need moderation in the quote opts
zio/stable
Hailey 2024-01-30 18:11:23 -08:00 committed by GitHub
parent 28455f49dc
commit 59aacf4126
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 18 additions and 6 deletions

View File

@ -1,5 +1,9 @@
import React from 'react'
import {AppBskyEmbedRecord, AppBskyRichtextFacet} from '@atproto/api'
import {
AppBskyEmbedRecord,
AppBskyRichtextFacet,
PostModeration,
} from '@atproto/api'
import {useNonReactiveCallback} from '#/lib/hooks/useNonReactiveCallback'
export interface ComposerOptsPostRef {
@ -12,6 +16,7 @@ export interface ComposerOptsPostRef {
avatar?: string
}
embed?: AppBskyEmbedRecord.ViewRecord['embed']
moderation?: PostModeration
}
export interface ComposerOptsQuote {
uri: string

View File

@ -83,7 +83,11 @@ export function ComposerReplyTo({replyTo}: {replyTo: ComposerOptsPostRef}) {
accessibilityHint={_(
msg`Expand or collapse the full post you are replying to`,
)}>
<UserAvatar avatar={replyTo.author.avatar} size={50} />
<UserAvatar
avatar={replyTo.author.avatar}
size={50}
moderation={replyTo.moderation?.avatar}
/>
<View style={styles.replyToPost}>
<Text type="xl-medium" style={[pal.text]}>
{sanitizeDisplayName(
@ -99,7 +103,7 @@ export function ComposerReplyTo({replyTo}: {replyTo: ComposerOptsPostRef}) {
{replyTo.text}
</Text>
</View>
{images && (
{images && !replyTo.moderation?.embed.blur && (
<ComposerReplyToImages images={images} showFull={showFull} />
)}
</View>

View File

@ -217,10 +217,11 @@ let PostThreadItemLoaded = ({
avatar: post.author.avatar,
},
embed: post.embed,
moderation,
},
onPost: onPostReply,
})
}, [openComposer, post, record, onPostReply])
}, [openComposer, post, record, onPostReply, moderation])
const onPressShowMore = React.useCallback(() => {
setLimitLines(false)

View File

@ -122,9 +122,10 @@ function PostInner({
avatar: post.author.avatar,
},
embed: post.embed,
moderation,
},
})
}, [openComposer, post, record])
}, [openComposer, post, record, moderation])
const onPressShowMore = React.useCallback(() => {
setLimitLines(false)

View File

@ -135,9 +135,10 @@ let FeedItemInner = ({
avatar: post.author.avatar,
},
embed: post.embed,
moderation,
},
})
}, [post, record, openComposer])
}, [post, record, openComposer, moderation])
const outerStyles = [
styles.outer,