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
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user