Fix image crop in quote posts, remove PostEmbedViewContext.FeedEmbedRecordWithMedia (#11205)

This commit is contained in:
Eric Bailey
2026-07-20 16:47:05 -05:00
committed by GitHub
parent 0f27fdda65
commit d3e7d99fa7
3 changed files with 4 additions and 8 deletions
+2 -3
View File
@@ -115,6 +115,7 @@ export function ImageEmbed({
onPress(0, [singleContainerRef.current], [singleDimsRef.current])
}
}
console.log(rest.viewContext, 'rest.viewContext')
return (
<View style={[a.mt_sm, rest.style]}>
<ImageContextMenu
@@ -127,9 +128,7 @@ export function ImageEmbed({
crop={
rest.viewContext === PostEmbedViewContext.ThreadHighlighted
? 'none'
: rest.isWithinQuote
? 'square'
: 'constrained'
: 'constrained'
}
image={image}
onContainerRef={ref => {
-1
View File
@@ -4,7 +4,6 @@ import {type AppBskyFeedDefs, type ModerationDecision} from '@atproto/api'
export enum PostEmbedViewContext {
ThreadHighlighted = 'ThreadHighlighted',
Feed = 'Feed',
FeedEmbedRecordWithMedia = 'FeedEmbedRecordWithMedia',
ChatMessage = 'ChatMessage',
}
+2 -4
View File
@@ -5,7 +5,7 @@ import {type AppBskyEmbedImages} from '@atproto/api'
import {atoms as a, useBreakpoints} from '#/alf'
import {type Dimensions} from '#/components/Lightbox/types'
import {PostEmbedViewContext} from '#/components/Post/Embed/types'
import {type PostEmbedViewContext} from '#/components/Post/Embed/types'
import {GalleryItem} from './ImageLayoutGridItem'
interface ImageLayoutGridProps {
@@ -28,9 +28,7 @@ export function ImageLayoutGrid({
...props
}: ImageLayoutGridProps) {
const {gtMobile} = useBreakpoints()
const isWithinQuote =
isWithinQuoteProp ??
props.viewContext === PostEmbedViewContext.FeedEmbedRecordWithMedia
const isWithinQuote = isWithinQuoteProp
const gap = isWithinQuote ? (gtMobile ? a.gap_xs : a.gap_2xs) : a.gap_xs
return (