* Fix EmojiFormatter failure * Add notification_emails.warning setting default value * Fix list spec failure and add antennas for spec response * Fix domain block spec failure to add kb custom response * Fix SearchQueryTransformer spec failure * Fix Account#matches_display_name spec failure * Fix UpdateStatusService changes mentions spec failure * Fix RuboCop Lint * Ignore brakeman warning * Fix CI failure for ignore brakeman warning * Fix migration failure * Fix README * Fix migration CI failure * Fix some spec failure * Format code for RuboCop lint failure * Fix ESlint failure * Fix haml-lint failure
31 lines
712 B
JavaScript
31 lines
712 B
JavaScript
import PropTypes from 'prop-types';
|
|
import { PureComponent } from 'react';
|
|
|
|
import emojify from '../features/emoji/emoji';
|
|
|
|
export default class EmojiView extends PureComponent {
|
|
|
|
static propTypes = {
|
|
name: PropTypes.string,
|
|
url: PropTypes.string,
|
|
staticUrl: PropTypes.string,
|
|
};
|
|
|
|
render () {
|
|
const { name, url, staticUrl } = this.props;
|
|
|
|
let emojiHtml = null;
|
|
if (url) {
|
|
let customEmojis = {};
|
|
customEmojis[`:${name}:`] = { url, static_url: staticUrl };
|
|
emojiHtml = emojify(`:${name}:`, customEmojis);
|
|
} else {
|
|
emojiHtml = emojify(name);
|
|
}
|
|
|
|
return (
|
|
<span className='emoji' dangerouslySetInnerHTML={{ __html: emojiHtml }} />
|
|
);
|
|
}
|
|
|
|
}
|