mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-24 13:53:23 +03:00
Merge pull request #2775 from ecency/fix/GU-2766/flash-list-bugs
fix: GU-2766 fix posts flicker and profile comments
This commit is contained in:
commit
0c18685c06
@ -225,10 +225,9 @@ const CommentView = ({
|
||||
: null;
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
<Fragment key={comment.permlink}>
|
||||
<View style={{ ...styles.commentContainer, ...customContainerStyle }}>
|
||||
<PostHeaderDescription
|
||||
key={comment.permlink}
|
||||
date={getTimeFromNow(comment.created)}
|
||||
name={comment.author}
|
||||
reputation={comment.author_reputation}
|
||||
|
@ -1,4 +1,4 @@
|
||||
import React, { useState } from 'react';
|
||||
import React, { useMemo, useState } from 'react';
|
||||
|
||||
import { TouchableOpacity, Text, View } from 'react-native';
|
||||
|
||||
@ -39,6 +39,10 @@ export const PostCardContent = ({
|
||||
const imgWidth = dim.width - 18;
|
||||
const [calcImgHeight, setCalcImgHeight] = useState(imageRatio ? imgWidth / imageRatio : 300);
|
||||
|
||||
const resizeMode = useMemo(() => {
|
||||
return calcImgHeight < dim.height ? FastImage.resizeMode.contain : FastImage.resizeMode.cover;
|
||||
}, [dim.height]);
|
||||
|
||||
const _onPress = () => {
|
||||
handleCardInteraction(PostCardActionIds.NAVIGATE, {
|
||||
name: ROUTES.SCREENS.POST,
|
||||
@ -75,9 +79,7 @@ export const PostCardContent = ({
|
||||
height: Math.min(calcImgHeight, dim.height),
|
||||
},
|
||||
]}
|
||||
resizeMode={
|
||||
calcImgHeight < dim.height ? FastImage.resizeMode.contain : FastImage.resizeMode.cover
|
||||
}
|
||||
resizeMode={resizeMode}
|
||||
onLoad={(evt) => {
|
||||
if (!imageRatio) {
|
||||
const _imgRatio = evt.nativeEvent.width / evt.nativeEvent.height;
|
||||
|
@ -64,6 +64,7 @@ export default EStyleSheet.create({
|
||||
commentsTabBar: {
|
||||
backgroundColor: '$primaryBackgroundColor',
|
||||
paddingTop: 5,
|
||||
flex: 1,
|
||||
},
|
||||
scrollContentContainer: {
|
||||
paddingBottom: 60,
|
||||
|
Loading…
Reference in New Issue
Block a user