Fix image crop in quote posts, remove PostEmbedViewContext.FeedEmbedRecordWithMedia (#11205)
(cherry picked from commit d3e7d99fa7)
This commit is contained in:
@@ -115,6 +115,7 @@ export function ImageEmbed({
|
|||||||
onPress(0, [singleContainerRef.current], [singleDimsRef.current])
|
onPress(0, [singleContainerRef.current], [singleDimsRef.current])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
console.log(rest.viewContext, 'rest.viewContext')
|
||||||
return (
|
return (
|
||||||
<View style={[a.mt_sm, rest.style]}>
|
<View style={[a.mt_sm, rest.style]}>
|
||||||
<ImageContextMenu
|
<ImageContextMenu
|
||||||
@@ -127,9 +128,7 @@ export function ImageEmbed({
|
|||||||
crop={
|
crop={
|
||||||
rest.viewContext === PostEmbedViewContext.ThreadHighlighted
|
rest.viewContext === PostEmbedViewContext.ThreadHighlighted
|
||||||
? 'none'
|
? 'none'
|
||||||
: rest.isWithinQuote
|
: 'constrained'
|
||||||
? 'square'
|
|
||||||
: 'constrained'
|
|
||||||
}
|
}
|
||||||
image={image}
|
image={image}
|
||||||
onContainerRef={ref => {
|
onContainerRef={ref => {
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import {type AppBskyFeedDefs, type ModerationDecision} from '@atproto/api'
|
|||||||
export enum PostEmbedViewContext {
|
export enum PostEmbedViewContext {
|
||||||
ThreadHighlighted = 'ThreadHighlighted',
|
ThreadHighlighted = 'ThreadHighlighted',
|
||||||
Feed = 'Feed',
|
Feed = 'Feed',
|
||||||
FeedEmbedRecordWithMedia = 'FeedEmbedRecordWithMedia',
|
|
||||||
ChatMessage = 'ChatMessage',
|
ChatMessage = 'ChatMessage',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import {type AppBskyEmbedImages} from '@atproto/api'
|
|||||||
|
|
||||||
import {atoms as a, useBreakpoints} from '#/alf'
|
import {atoms as a, useBreakpoints} from '#/alf'
|
||||||
import {type Dimensions} from '#/components/Lightbox/types'
|
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'
|
import {GalleryItem} from './ImageLayoutGridItem'
|
||||||
|
|
||||||
interface ImageLayoutGridProps {
|
interface ImageLayoutGridProps {
|
||||||
@@ -28,9 +28,7 @@ export function ImageLayoutGrid({
|
|||||||
...props
|
...props
|
||||||
}: ImageLayoutGridProps) {
|
}: ImageLayoutGridProps) {
|
||||||
const {gtMobile} = useBreakpoints()
|
const {gtMobile} = useBreakpoints()
|
||||||
const isWithinQuote =
|
const isWithinQuote = isWithinQuoteProp
|
||||||
isWithinQuoteProp ??
|
|
||||||
props.viewContext === PostEmbedViewContext.FeedEmbedRecordWithMedia
|
|
||||||
const gap = isWithinQuote ? (gtMobile ? a.gap_xs : a.gap_2xs) : a.gap_xs
|
const gap = isWithinQuote ? (gtMobile ? a.gap_xs : a.gap_2xs) : a.gap_xs
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user