pleroma/app/gabsocial/components/emoji_selector.js
2020-05-21 21:14:15 -05:00

28 lines
673 B
JavaScript

import React from 'react';
import PropTypes from 'prop-types';
import { ALLOWED_EMOJI } from 'gabsocial/utils/emoji_reacts';
import emojify from 'gabsocial/features/emoji/emoji';
export default class EmojiSelector extends React.Component {
propTypes = {
onReact: PropTypes.func.isRequired,
}
render() {
const { onReact } = this.props;
return (
<div className='emoji-react-selector'>
{ALLOWED_EMOJI.map(emoji => (
<button
className='emoji-react-selector__emoji'
dangerouslySetInnerHTML={{ __html: emojify(emoji) }}
onClick={onReact(emoji)}
/>
))}
</div>
);
}
}