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:
Feruz M 2023-10-11 20:26:31 +03:00 committed by GitHub
commit 0c18685c06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 6 deletions

View File

@ -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}

View File

@ -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;

View File

@ -64,6 +64,7 @@ export default EStyleSheet.create({
commentsTabBar: {
backgroundColor: '$primaryBackgroundColor',
paddingTop: 5,
flex: 1,
},
scrollContentContainer: {
paddingBottom: 60,