pleroma/app/gabsocial/features/status/components/status_interaction_bar.js
2020-05-19 22:54:05 -05:00

47 lines
974 B
JavaScript

import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import emojify from 'gabsocial/features/emoji/emoji';
// https://emojipedia.org/facebook/
const ALLOWED_EMOJI = [
'👍',
'❤️',
'😂',
'😯',
'😢',
'😡',
];
export class StatusInteractionBar extends React.Component {
propTypes = {
status: ImmutablePropTypes.map,
}
sortEmoji = emojiReacts => (
emojiReacts // TODO: Sort
);
mergeEmoji = emojiReacts => (
emojiReacts // TODO: Merge similar emoji
);
filterEmoji = emojiReacts => (
emojiReacts.filter(emojiReact => (
ALLOWED_EMOJI.includes(emojiReact.get('name'))
)))
render() {
const { status } = this.props;
const emojiReacts = status.getIn(['pleroma', 'emoji_reactions']);
return (
<>
{this.filterEmoji(emojiReacts).map(e =>
<span dangerouslySetInnerHTML={{ __html: emojify(e.get('name')) }} />
)}
</>
);
}
}