2018-01-16 18:48:05 +00:00
|
|
|
import React from 'react';
|
2018-07-18 20:34:59 +00:00
|
|
|
import { ViewPropTypes, Image } from 'react-native';
|
2018-01-16 18:48:05 +00:00
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
2018-02-08 14:08:50 +00:00
|
|
|
export default class CustomEmoji extends React.Component {
|
2018-01-16 18:48:05 +00:00
|
|
|
static propTypes = {
|
|
|
|
baseUrl: PropTypes.string.isRequired,
|
|
|
|
emoji: PropTypes.object.isRequired,
|
2018-02-08 14:08:50 +00:00
|
|
|
style: ViewPropTypes.style
|
2018-01-16 18:48:05 +00:00
|
|
|
}
|
2018-01-30 19:48:26 +00:00
|
|
|
shouldComponentUpdate() {
|
|
|
|
return false;
|
|
|
|
}
|
2018-01-16 18:48:05 +00:00
|
|
|
render() {
|
|
|
|
const { baseUrl, emoji, style } = this.props;
|
|
|
|
return (
|
2018-07-18 20:34:59 +00:00
|
|
|
<Image
|
2018-01-16 18:48:05 +00:00
|
|
|
style={style}
|
2018-01-30 19:48:26 +00:00
|
|
|
source={{ uri: `${ baseUrl }/emoji-custom/${ encodeURIComponent(emoji.content || emoji.name) }.${ emoji.extension }` }}
|
2018-01-16 18:48:05 +00:00
|
|
|
/>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|