Fix translations for posts on profiles
This commit is contained in:
@@ -533,7 +533,6 @@ const ThreadItemAnchorInner = memo(function ThreadItemAnchorInner({
|
|||||||
feedContext={postSource?.post?.feedContext}
|
feedContext={postSource?.post?.feedContext}
|
||||||
reqId={postSource?.post?.reqId}
|
reqId={postSource?.post?.reqId}
|
||||||
viaRepost={viaRepost}
|
viaRepost={viaRepost}
|
||||||
forceGoogleTranslate={true}
|
|
||||||
/>
|
/>
|
||||||
</FeedFeedbackProvider>
|
</FeedFeedbackProvider>
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ import {Embed} from '#/components/Post/Embed'
|
|||||||
import {PostEmbedViewContext} from '#/components/Post/Embed/types'
|
import {PostEmbedViewContext} from '#/components/Post/Embed/types'
|
||||||
import {PostRepliedTo} from '#/components/Post/PostRepliedTo'
|
import {PostRepliedTo} from '#/components/Post/PostRepliedTo'
|
||||||
import {ShowMoreTextButton} from '#/components/Post/ShowMoreTextButton'
|
import {ShowMoreTextButton} from '#/components/Post/ShowMoreTextButton'
|
||||||
|
import {TranslatedPost} from '#/components/Post/Translated'
|
||||||
import {PostControls} from '#/components/PostControls'
|
import {PostControls} from '#/components/PostControls'
|
||||||
import {DiscoverDebug} from '#/components/PostControls/DiscoverDebug'
|
import {DiscoverDebug} from '#/components/PostControls/DiscoverDebug'
|
||||||
import {RichText} from '#/components/RichText'
|
import {RichText} from '#/components/RichText'
|
||||||
@@ -450,6 +451,14 @@ let PostContent = ({
|
|||||||
: []
|
: []
|
||||||
}, [post, currentAccount?.did, threadgateHiddenReplies])
|
}, [post, currentAccount?.did, threadgateHiddenReplies])
|
||||||
|
|
||||||
|
const record = useMemo<AppBskyFeedPost.Record | undefined>(
|
||||||
|
() =>
|
||||||
|
bsky.validate(post.record, AppBskyFeedPost.validateRecord)
|
||||||
|
? post.record
|
||||||
|
: undefined,
|
||||||
|
[post],
|
||||||
|
)
|
||||||
|
|
||||||
const onPressShowMore = useCallback(() => {
|
const onPressShowMore = useCallback(() => {
|
||||||
setLimitLines(false)
|
setLimitLines(false)
|
||||||
}, [setLimitLines])
|
}, [setLimitLines])
|
||||||
@@ -466,6 +475,7 @@ let PostContent = ({
|
|||||||
additionalCauses={additionalPostAlerts}
|
additionalCauses={additionalPostAlerts}
|
||||||
/>
|
/>
|
||||||
{richText.text ? (
|
{richText.text ? (
|
||||||
|
<>
|
||||||
<View style={[a.mb_2xs]}>
|
<View style={[a.mb_2xs]}>
|
||||||
<RichText
|
<RichText
|
||||||
enableTags
|
enableTags
|
||||||
@@ -477,9 +487,16 @@ let PostContent = ({
|
|||||||
shouldProxyLinks={true}
|
shouldProxyLinks={true}
|
||||||
/>
|
/>
|
||||||
{limitLines && (
|
{limitLines && (
|
||||||
<ShowMoreTextButton style={[a.text_md]} onPress={onPressShowMore} />
|
<ShowMoreTextButton
|
||||||
|
style={[a.text_md]}
|
||||||
|
onPress={onPressShowMore}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
</View>
|
</View>
|
||||||
|
{record && (
|
||||||
|
<TranslatedPost translationKey={post.uri} postText={record.text} />
|
||||||
|
)}
|
||||||
|
</>
|
||||||
) : undefined}
|
) : undefined}
|
||||||
{postEmbed ? (
|
{postEmbed ? (
|
||||||
<View style={[a.pb_xs]}>
|
<View style={[a.pb_xs]}>
|
||||||
|
|||||||
Reference in New Issue
Block a user