moderate avatars and embeds in composer reply to (#2665)
* moderate avatars and embeds in composer reply to * oops * dont need moderation in the quote optszio/stable
parent
28455f49dc
commit
59aacf4126
|
@ -1,5 +1,9 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import {AppBskyEmbedRecord, AppBskyRichtextFacet} from '@atproto/api'
|
import {
|
||||||
|
AppBskyEmbedRecord,
|
||||||
|
AppBskyRichtextFacet,
|
||||||
|
PostModeration,
|
||||||
|
} from '@atproto/api'
|
||||||
import {useNonReactiveCallback} from '#/lib/hooks/useNonReactiveCallback'
|
import {useNonReactiveCallback} from '#/lib/hooks/useNonReactiveCallback'
|
||||||
|
|
||||||
export interface ComposerOptsPostRef {
|
export interface ComposerOptsPostRef {
|
||||||
|
@ -12,6 +16,7 @@ export interface ComposerOptsPostRef {
|
||||||
avatar?: string
|
avatar?: string
|
||||||
}
|
}
|
||||||
embed?: AppBskyEmbedRecord.ViewRecord['embed']
|
embed?: AppBskyEmbedRecord.ViewRecord['embed']
|
||||||
|
moderation?: PostModeration
|
||||||
}
|
}
|
||||||
export interface ComposerOptsQuote {
|
export interface ComposerOptsQuote {
|
||||||
uri: string
|
uri: string
|
||||||
|
|
|
@ -83,7 +83,11 @@ export function ComposerReplyTo({replyTo}: {replyTo: ComposerOptsPostRef}) {
|
||||||
accessibilityHint={_(
|
accessibilityHint={_(
|
||||||
msg`Expand or collapse the full post you are replying to`,
|
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}>
|
<View style={styles.replyToPost}>
|
||||||
<Text type="xl-medium" style={[pal.text]}>
|
<Text type="xl-medium" style={[pal.text]}>
|
||||||
{sanitizeDisplayName(
|
{sanitizeDisplayName(
|
||||||
|
@ -99,7 +103,7 @@ export function ComposerReplyTo({replyTo}: {replyTo: ComposerOptsPostRef}) {
|
||||||
{replyTo.text}
|
{replyTo.text}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
{images && (
|
{images && !replyTo.moderation?.embed.blur && (
|
||||||
<ComposerReplyToImages images={images} showFull={showFull} />
|
<ComposerReplyToImages images={images} showFull={showFull} />
|
||||||
)}
|
)}
|
||||||
</View>
|
</View>
|
||||||
|
|
|
@ -217,10 +217,11 @@ let PostThreadItemLoaded = ({
|
||||||
avatar: post.author.avatar,
|
avatar: post.author.avatar,
|
||||||
},
|
},
|
||||||
embed: post.embed,
|
embed: post.embed,
|
||||||
|
moderation,
|
||||||
},
|
},
|
||||||
onPost: onPostReply,
|
onPost: onPostReply,
|
||||||
})
|
})
|
||||||
}, [openComposer, post, record, onPostReply])
|
}, [openComposer, post, record, onPostReply, moderation])
|
||||||
|
|
||||||
const onPressShowMore = React.useCallback(() => {
|
const onPressShowMore = React.useCallback(() => {
|
||||||
setLimitLines(false)
|
setLimitLines(false)
|
||||||
|
|
|
@ -122,9 +122,10 @@ function PostInner({
|
||||||
avatar: post.author.avatar,
|
avatar: post.author.avatar,
|
||||||
},
|
},
|
||||||
embed: post.embed,
|
embed: post.embed,
|
||||||
|
moderation,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}, [openComposer, post, record])
|
}, [openComposer, post, record, moderation])
|
||||||
|
|
||||||
const onPressShowMore = React.useCallback(() => {
|
const onPressShowMore = React.useCallback(() => {
|
||||||
setLimitLines(false)
|
setLimitLines(false)
|
||||||
|
|
|
@ -135,9 +135,10 @@ let FeedItemInner = ({
|
||||||
avatar: post.author.avatar,
|
avatar: post.author.avatar,
|
||||||
},
|
},
|
||||||
embed: post.embed,
|
embed: post.embed,
|
||||||
|
moderation,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}, [post, record, openComposer])
|
}, [post, record, openComposer, moderation])
|
||||||
|
|
||||||
const outerStyles = [
|
const outerStyles = [
|
||||||
styles.outer,
|
styles.outer,
|
||||||
|
|
Loading…
Reference in New Issue