Allow images to use specified aspectRatios (#2558)
parent
66b8774ecb
commit
89f4105082
|
@ -22,7 +22,6 @@ import {Link} from '../Link'
|
||||||
import {ImageLayoutGrid} from '../images/ImageLayoutGrid'
|
import {ImageLayoutGrid} from '../images/ImageLayoutGrid'
|
||||||
import {useLightboxControls, ImagesLightbox} from '#/state/lightbox'
|
import {useLightboxControls, ImagesLightbox} from '#/state/lightbox'
|
||||||
import {usePalette} from 'lib/hooks/usePalette'
|
import {usePalette} from 'lib/hooks/usePalette'
|
||||||
import {useWebMediaQueries} from 'lib/hooks/useWebMediaQueries'
|
|
||||||
import {ExternalLinkEmbed} from './ExternalLinkEmbed'
|
import {ExternalLinkEmbed} from './ExternalLinkEmbed'
|
||||||
import {MaybeQuoteEmbed} from './QuoteEmbed'
|
import {MaybeQuoteEmbed} from './QuoteEmbed'
|
||||||
import {AutoSizedImage} from '../images/AutoSizedImage'
|
import {AutoSizedImage} from '../images/AutoSizedImage'
|
||||||
|
@ -51,7 +50,6 @@ export function PostEmbeds({
|
||||||
}) {
|
}) {
|
||||||
const pal = usePalette('default')
|
const pal = usePalette('default')
|
||||||
const {openLightbox} = useLightboxControls()
|
const {openLightbox} = useLightboxControls()
|
||||||
const {isMobile} = useWebMediaQueries()
|
|
||||||
|
|
||||||
// quote post with media
|
// quote post with media
|
||||||
// =
|
// =
|
||||||
|
@ -129,10 +127,7 @@ export function PostEmbeds({
|
||||||
dimensionsHint={aspectRatio}
|
dimensionsHint={aspectRatio}
|
||||||
onPress={() => _openLightbox(0)}
|
onPress={() => _openLightbox(0)}
|
||||||
onPressIn={() => onPressIn(0)}
|
onPressIn={() => onPressIn(0)}
|
||||||
style={[
|
style={[styles.singleImage]}>
|
||||||
styles.singleImage,
|
|
||||||
isMobile && styles.singleImageMobile,
|
|
||||||
]}>
|
|
||||||
{alt === '' ? null : (
|
{alt === '' ? null : (
|
||||||
<View style={styles.altContainer}>
|
<View style={styles.altContainer}>
|
||||||
<Text style={styles.alt} accessible={false}>
|
<Text style={styles.alt} accessible={false}>
|
||||||
|
@ -151,11 +146,7 @@ export function PostEmbeds({
|
||||||
images={embed.images}
|
images={embed.images}
|
||||||
onPress={_openLightbox}
|
onPress={_openLightbox}
|
||||||
onPressIn={onPressIn}
|
onPressIn={onPressIn}
|
||||||
style={
|
style={embed.images.length === 1 ? [styles.singleImage] : undefined}
|
||||||
embed.images.length === 1
|
|
||||||
? [styles.singleImage, isMobile && styles.singleImageMobile]
|
|
||||||
: undefined
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
|
@ -188,10 +179,6 @@ const styles = StyleSheet.create({
|
||||||
},
|
},
|
||||||
singleImage: {
|
singleImage: {
|
||||||
borderRadius: 8,
|
borderRadius: 8,
|
||||||
maxHeight: 1000,
|
|
||||||
},
|
|
||||||
singleImageMobile: {
|
|
||||||
maxHeight: 500,
|
|
||||||
},
|
},
|
||||||
extOuter: {
|
extOuter: {
|
||||||
borderWidth: 1,
|
borderWidth: 1,
|
||||||
|
|
Loading…
Reference in New Issue