[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 React from 'react';
|
||||||
import { Image } from 'react-native';
|
import FastImage from 'react-native-fast-image';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
export default class CustomEmoji extends React.Component {
|
export default class CustomEmoji extends React.Component {
|
||||||
|
@ -16,9 +16,13 @@ export default class CustomEmoji extends React.Component {
|
||||||
render() {
|
render() {
|
||||||
const { baseUrl, emoji, style } = this.props;
|
const { baseUrl, emoji, style } = this.props;
|
||||||
return (
|
return (
|
||||||
<Image
|
<FastImage
|
||||||
style={style}
|
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 (
|
return (
|
||||||
<View style={styles.block}>
|
<View style={styles.block}>
|
||||||
|
<Text>
|
||||||
{children}
|
{children}
|
||||||
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue