mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-21 04:11:50 +03:00
Merge pull request #1072 from esteemapp/bugfix/img-render
Fixed img render issue
This commit is contained in:
commit
417afda0ce
@ -65,14 +65,7 @@ export default EStyleSheet.create({
|
|||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
},
|
},
|
||||||
postImage: {
|
img: {
|
||||||
marginTop: 10,
|
alignSelf: 'center',
|
||||||
minHeight: 216,
|
|
||||||
width: '100%',
|
|
||||||
},
|
|
||||||
commentImage: {
|
|
||||||
marginTop: 10,
|
|
||||||
minHeight: 80,
|
|
||||||
width: '100%',
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -2,8 +2,6 @@ import React, { PureComponent, Fragment } from 'react';
|
|||||||
import { Dimensions, Linking, Alert, TouchableOpacity, Text } from 'react-native';
|
import { Dimensions, Linking, Alert, TouchableOpacity, Text } from 'react-native';
|
||||||
import { withNavigation } from 'react-navigation';
|
import { withNavigation } from 'react-navigation';
|
||||||
import { injectIntl } from 'react-intl';
|
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 HTML from 'react-native-render-html';
|
||||||
import { getParentsTagsRecursively } from 'react-native-render-html/src/HTMLUtils';
|
import { getParentsTagsRecursively } from 'react-native-render-html/src/HTMLUtils';
|
||||||
@ -13,7 +11,6 @@ import styles from './postBodyStyles';
|
|||||||
|
|
||||||
// Constants
|
// Constants
|
||||||
import { default as ROUTES } from '../../../../constants/routeNames';
|
import { default as ROUTES } from '../../../../constants/routeNames';
|
||||||
import DEFAULT_IMAGE from '../../../../assets/no_image.png';
|
|
||||||
// Components
|
// Components
|
||||||
|
|
||||||
const WIDTH = Dimensions.get('window').width;
|
const WIDTH = Dimensions.get('window').width;
|
||||||
@ -153,18 +150,6 @@ class PostBody extends PureComponent {
|
|||||||
: { width: WIDTH, height: 216 };
|
: { width: WIDTH, height: 216 };
|
||||||
|
|
||||||
const _customRenderer = {
|
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) => {
|
a: (htmlAttribs, children, convertedCSSStyles, passProps) => {
|
||||||
if (passProps.parentWrapper === 'Text') {
|
if (passProps.parentWrapper === 'Text') {
|
||||||
return (
|
return (
|
||||||
|
Loading…
Reference in New Issue
Block a user