diff --git a/src/components/dms/MessageItemEmbed.tsx b/src/components/dms/MessageItemEmbed.tsx index dbdbe95b..aefd62b9 100644 --- a/src/components/dms/MessageItemEmbed.tsx +++ b/src/components/dms/MessageItemEmbed.tsx @@ -14,7 +14,7 @@ let MessageItemEmbed = ({ return ( - + ) } diff --git a/src/view/com/util/post-embeds/QuoteEmbed.tsx b/src/view/com/util/post-embeds/QuoteEmbed.tsx index cdbdafc9..d7624b43 100644 --- a/src/view/com/util/post-embeds/QuoteEmbed.tsx +++ b/src/view/com/util/post-embeds/QuoteEmbed.tsx @@ -2,7 +2,6 @@ import React from 'react' import { StyleProp, StyleSheet, - TextStyle, TouchableOpacity, View, ViewStyle, @@ -32,7 +31,7 @@ import {InfoCircleIcon} from 'lib/icons' import {makeProfileLink} from 'lib/routes/links' import {precacheProfile} from 'state/queries/profile' import {ComposerOptsQuote} from 'state/shell/composer' -import {atoms as a, flatten} from '#/alf' +import {atoms as a} from '#/alf' import {RichText} from '#/components/RichText' import {ContentHider} from '../../../../components/moderation/ContentHider' import {PostAlerts} from '../../../../components/moderation/PostAlerts' @@ -46,12 +45,12 @@ export function MaybeQuoteEmbed({ embed, onOpen, style, - textStyle, + allowNestedQuotes, }: { embed: AppBskyEmbedRecord.View onOpen?: () => void style?: StyleProp - textStyle?: StyleProp + allowNestedQuotes?: boolean }) { const pal = usePalette('default') if ( @@ -65,7 +64,7 @@ export function MaybeQuoteEmbed({ postRecord={embed.record.value} onOpen={onOpen} style={style} - textStyle={textStyle} + allowNestedQuotes={allowNestedQuotes} /> ) } else if (AppBskyEmbedRecord.isViewBlocked(embed.record)) { @@ -95,13 +94,13 @@ function QuoteEmbedModerated({ postRecord, onOpen, style, - textStyle, + allowNestedQuotes, }: { viewRecord: AppBskyEmbedRecord.ViewRecord postRecord: AppBskyFeedPost.Record onOpen?: () => void style?: StyleProp - textStyle?: StyleProp + allowNestedQuotes?: boolean }) { const moderationOpts = useModerationOpts() const moderation = React.useMemo(() => { @@ -126,7 +125,7 @@ function QuoteEmbedModerated({ moderation={moderation} onOpen={onOpen} style={style} - textStyle={textStyle} + allowNestedQuotes={allowNestedQuotes} /> ) } @@ -136,13 +135,13 @@ export function QuoteEmbed({ moderation, onOpen, style, - textStyle, + allowNestedQuotes, }: { quote: ComposerOptsQuote moderation?: ModerationDecision onOpen?: () => void style?: StyleProp - textStyle?: StyleProp + allowNestedQuotes?: boolean }) { const queryClient = useQueryClient() const pal = usePalette('default') @@ -161,16 +160,20 @@ export function QuoteEmbed({ const embed = React.useMemo(() => { const e = quote.embeds?.[0] - if (AppBskyEmbedImages.isView(e) || AppBskyEmbedExternal.isView(e)) { + if (allowNestedQuotes) { return e - } else if ( - AppBskyEmbedRecordWithMedia.isView(e) && - (AppBskyEmbedImages.isView(e.media) || - AppBskyEmbedExternal.isView(e.media)) - ) { - return e.media + } else { + if (AppBskyEmbedImages.isView(e) || AppBskyEmbedExternal.isView(e)) { + return e + } else if ( + AppBskyEmbedRecordWithMedia.isView(e) && + (AppBskyEmbedImages.isView(e.media) || + AppBskyEmbedExternal.isView(e.media)) + ) { + return e.media + } } - }, [quote.embeds]) + }, [quote.embeds, allowNestedQuotes]) const onBeforePress = React.useCallback(() => { precacheProfile(queryClient, quote.author) @@ -201,7 +204,7 @@ export function QuoteEmbed({ {richText ? ( diff --git a/src/view/com/util/post-embeds/index.tsx b/src/view/com/util/post-embeds/index.tsx index 962f3d8c..a13fffc3 100644 --- a/src/view/com/util/post-embeds/index.tsx +++ b/src/view/com/util/post-embeds/index.tsx @@ -4,7 +4,6 @@ import { StyleProp, StyleSheet, Text, - TextStyle, View, ViewStyle, } from 'react-native' @@ -42,13 +41,13 @@ export function PostEmbeds({ moderation, onOpen, style, - quoteTextStyle, + allowNestedQuotes, }: { embed?: Embed moderation?: ModerationDecision onOpen?: () => void style?: StyleProp - quoteTextStyle?: StyleProp + allowNestedQuotes?: boolean }) { const pal = usePalette('default') const {openLightbox} = useLightboxControls() @@ -63,11 +62,7 @@ export function PostEmbeds({ moderation={moderation} onOpen={onOpen} /> - + ) } @@ -98,8 +93,8 @@ export function PostEmbeds({ ) }