Handle nested quotes same as prod
This commit is contained in:
@@ -149,6 +149,10 @@ function RecordEmbed({
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
case 'post': {
|
case 'post': {
|
||||||
|
if (rest.isWithinQuote && !rest.allowNestedQuotes) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<QuoteEmbed
|
<QuoteEmbed
|
||||||
{...rest}
|
{...rest}
|
||||||
@@ -158,6 +162,8 @@ function RecordEmbed({
|
|||||||
? QuoteEmbedViewContext.FeedEmbedRecordWithMedia
|
? QuoteEmbedViewContext.FeedEmbedRecordWithMedia
|
||||||
: undefined
|
: undefined
|
||||||
}
|
}
|
||||||
|
isWithinQuote={rest.isWithinQuote}
|
||||||
|
allowNestedQuotes={rest.allowNestedQuotes}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -213,6 +219,8 @@ export function QuoteEmbed({
|
|||||||
embed,
|
embed,
|
||||||
onOpen,
|
onOpen,
|
||||||
style,
|
style,
|
||||||
|
isWithinQuote: parentIsWithinQuote,
|
||||||
|
allowNestedQuotes: parentAllowNestedQuotes,
|
||||||
}: Omit<CommonProps, 'viewContext'> & {
|
}: Omit<CommonProps, 'viewContext'> & {
|
||||||
embed: EmbedType<'post'>
|
embed: EmbedType<'post'>
|
||||||
viewContext?: QuoteEmbedViewContext
|
viewContext?: QuoteEmbedViewContext
|
||||||
@@ -306,7 +314,17 @@ export function QuoteEmbed({
|
|||||||
disableLinks
|
disableLinks
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
{quote.embed && <Embed embed={quote.embed} moderation={moderation} />}
|
{quote.embed && (
|
||||||
|
<Embed
|
||||||
|
embed={quote.embed}
|
||||||
|
moderation={moderation}
|
||||||
|
isWithinQuote={parentIsWithinQuote ?? true}
|
||||||
|
// already within quote? override nested
|
||||||
|
allowNestedQuotes={
|
||||||
|
parentIsWithinQuote ? false : parentAllowNestedQuotes
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</Link>
|
</Link>
|
||||||
</ContentHider>
|
</ContentHider>
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import {StyleProp, ViewStyle} from 'react-native'
|
import {type StyleProp, type ViewStyle} from 'react-native'
|
||||||
import {AppBskyFeedDefs, ModerationDecision} from '@atproto/api'
|
import {type AppBskyFeedDefs, type ModerationDecision} from '@atproto/api'
|
||||||
|
|
||||||
export enum PostEmbedViewContext {
|
export enum PostEmbedViewContext {
|
||||||
ThreadHighlighted = 'ThreadHighlighted',
|
ThreadHighlighted = 'ThreadHighlighted',
|
||||||
@@ -15,8 +15,9 @@ export type CommonProps = {
|
|||||||
moderation?: ModerationDecision
|
moderation?: ModerationDecision
|
||||||
onOpen?: () => void
|
onOpen?: () => void
|
||||||
style?: StyleProp<ViewStyle>
|
style?: StyleProp<ViewStyle>
|
||||||
allowNestedQuotes?: boolean
|
|
||||||
viewContext?: PostEmbedViewContext
|
viewContext?: PostEmbedViewContext
|
||||||
|
isWithinQuote?: boolean
|
||||||
|
allowNestedQuotes?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export type EmbedProps = CommonProps & {
|
export type EmbedProps = CommonProps & {
|
||||||
|
|||||||
Reference in New Issue
Block a user