[IMPROVEMENT] Use FastImage on custom emojis (#1195)
* Use fastImage to custom emojis * Add Text component on Paragraph render
This commit is contained in:
parent
37e7e6ed6f
commit
8d4d522b63
File diff suppressed because it is too large
Load Diff
|
@ -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}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -162,7 +162,9 @@ export default class Markdown extends PureComponent {
|
|||
}
|
||||
return (
|
||||
<View style={styles.block}>
|
||||
<Text>
|
||||
{children}
|
||||
</Text>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue