mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-19 11:21:41 +03:00
limiting image height while avoiding white spacing
This commit is contained in:
parent
e3833cc782
commit
92a506a061
@ -106,10 +106,14 @@ const PostCardView = ({
|
||||
styles.thumbnail,
|
||||
{
|
||||
width: dim.width - 18,
|
||||
height: calcImgHeight,
|
||||
height: Math.min(calcImgHeight, dim.height),
|
||||
},
|
||||
]}
|
||||
resizeMode={FastImage.resizeMode.contain}
|
||||
resizeMode={
|
||||
calcImgHeight < dim.height
|
||||
? FastImage.resizeMode.contain
|
||||
: FastImage.resizeMode.cover
|
||||
}
|
||||
onLoad={(evt) => {
|
||||
setCalcImgHeight((evt.nativeEvent.height / evt.nativeEvent.width) * dim.width - 18);
|
||||
}}
|
||||
|
Loading…
Reference in New Issue
Block a user