Merge pull request #1072 from esteemapp/bugfix/img-render

Fixed img render issue
This commit is contained in:
uğur erdal 2019-08-25 14:51:10 +03:00 committed by GitHub
commit 417afda0ce
2 changed files with 2 additions and 24 deletions

View File

@ -65,14 +65,7 @@ export default EStyleSheet.create({
alignItems: 'center',
justifyContent: 'center',
},
postImage: {
marginTop: 10,
minHeight: 216,
width: '100%',
},
commentImage: {
marginTop: 10,
minHeight: 80,
width: '100%',
img: {
alignSelf: 'center',
},
});

View File

@ -2,8 +2,6 @@ import React, { PureComponent, Fragment } from 'react';
import { Dimensions, Linking, Alert, TouchableOpacity, Text } from 'react-native';
import { withNavigation } from 'react-navigation';
import { injectIntl } from 'react-intl';
import FastImage from 'react-native-fast-image';
import { proxifyImageSrc } from '@esteemapp/esteem-render-helpers';
import HTML from 'react-native-render-html';
import { getParentsTagsRecursively } from 'react-native-render-html/src/HTMLUtils';
@ -13,7 +11,6 @@ import styles from './postBodyStyles';
// Constants
import { default as ROUTES } from '../../../../constants/routeNames';
import DEFAULT_IMAGE from '../../../../assets/no_image.png';
// Components
const WIDTH = Dimensions.get('window').width;
@ -153,18 +150,6 @@ class PostBody extends PureComponent {
: { width: WIDTH, height: 216 };
const _customRenderer = {
img: (htmlAttribs, children, convertedCSSStyles, passProps) => (
<FastImage
key={passProps.key}
defaultSource={DEFAULT_IMAGE}
source={{
uri: proxifyImageSrc(htmlAttribs.src, _initialDimensions.width, 0),
priority: FastImage.priority.normal,
}}
style={isComment ? styles.commentImage : styles.postImage}
resizeMode={FastImage.resizeMode.contain}
/>
),
a: (htmlAttribs, children, convertedCSSStyles, passProps) => {
if (passProps.parentWrapper === 'Text') {
return (