[IMPROVEMENT] Use FastImage on custom emojis (#1195)

* Use fastImage to custom emojis

* Add Text component on Paragraph render
This commit is contained in:
Djorkaeff Alexandre 2019-09-17 10:18:36 -03:00 committed by Diego Mello
parent 37e7e6ed6f
commit 8d4d522b63
3 changed files with 3962 additions and 3495 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
import React from 'react';
import { Image } from 'react-native';
import FastImage from 'react-native-fast-image';
import PropTypes from 'prop-types';
export default class CustomEmoji extends React.Component {
@ -16,9 +16,13 @@ export default class CustomEmoji extends React.Component {
render() {
const { baseUrl, emoji, style } = this.props;
return (
<Image
<FastImage
style={style}
source={{ uri: `${ baseUrl }/emoji-custom/${ encodeURIComponent(emoji.content || emoji.name) }.${ emoji.extension }` }}
source={{
uri: `${ baseUrl }/emoji-custom/${ encodeURIComponent(emoji.content || emoji.name) }.${ emoji.extension }`,
priority: FastImage.priority.high
}}
resizeMode={FastImage.resizeMode.contain}
/>
);
}

View File

@ -162,7 +162,9 @@ export default class Markdown extends PureComponent {
}
return (
<View style={styles.block}>
{children}
<Text>
{children}
</Text>
</View>
);
};