Skip to content

Commit

Permalink
Remove record-with-media side-by-side layout (#5182)
Browse files Browse the repository at this point in the history
  • Loading branch information
estrattonbailey authored Sep 6, 2024
1 parent 5546859 commit b90cd68
Showing 1 changed file with 11 additions and 42 deletions.
53 changes: 11 additions & 42 deletions src/view/com/util/post-embeds/QuoteEmbed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ 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, useBreakpoints} 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'
import {Link} from '../Link'
import {PostMeta} from '../PostMeta'
import {Text} from '../text/Text'
import {PostEmbeds} from '.'
import {PostEmbedViewContext, QuoteEmbedViewContext} from './types'
import {QuoteEmbedViewContext} from './types'

export function MaybeQuoteEmbed({
embed,
Expand Down Expand Up @@ -161,7 +161,6 @@ export function QuoteEmbed({
onOpen,
style,
allowNestedQuotes,
viewContext,
}: {
quote: ComposerOptsQuote
moderation?: ModerationDecision
Expand All @@ -175,7 +174,6 @@ export function QuoteEmbed({
const itemUrip = new AtUri(quote.uri)
const itemHref = makeProfileLink(quote.author, 'post', itemUrip.rkey)
const itemTitle = `Post by ${quote.author.handle}`
const {gtMobile} = useBreakpoints()

const richText = React.useMemo(
() =>
Expand Down Expand Up @@ -207,7 +205,6 @@ export function QuoteEmbed({
}
}
}, [quote.embeds, allowNestedQuotes])
const isImagesEmbed = AppBskyEmbedImages.isView(embed)

const onBeforePress = React.useCallback(() => {
precacheProfile(queryClient, quote.author)
Expand Down Expand Up @@ -237,43 +234,15 @@ export function QuoteEmbed({
{moderation ? (
<PostAlerts modui={moderation.ui('contentView')} style={[a.py_xs]} />
) : null}

{viewContext === QuoteEmbedViewContext.FeedEmbedRecordWithMedia &&
isImagesEmbed ? (
<View style={[a.flex_row, a.gap_md]}>
{embed && (
<View style={[{width: gtMobile ? 100 : 80}]}>
<PostEmbeds
embed={embed}
moderation={moderation}
viewContext={PostEmbedViewContext.FeedEmbedRecordWithMedia}
/>
</View>
)}
{richText ? (
<View style={[a.flex_1, a.pt_xs]}>
<RichText
value={richText}
style={a.text_md}
numberOfLines={20}
disableLinks
/>
</View>
) : null}
</View>
) : (
<>
{richText ? (
<RichText
value={richText}
style={a.text_md}
numberOfLines={20}
disableLinks
/>
) : null}
{embed && <PostEmbeds embed={embed} moderation={moderation} />}
</>
)}
{richText ? (
<RichText
value={richText}
style={a.text_md}
numberOfLines={20}
disableLinks
/>
) : null}
{embed && <PostEmbeds embed={embed} moderation={moderation} />}
</Link>
</ContentHider>
)
Expand Down

0 comments on commit b90cd68

Please sign in to comment.