@@ -712,6 +721,8 @@ class Status extends ImmutablePureComponent {
{expanded && hashtagBar}
+ {emojiReactionsBar}
+
diff --git a/app/javascript/mastodon/components/status_emoji_reactions_bar.jsx b/app/javascript/mastodon/components/status_emoji_reactions_bar.jsx
new file mode 100644
index 000000000..d00833992
--- /dev/null
+++ b/app/javascript/mastodon/components/status_emoji_reactions_bar.jsx
@@ -0,0 +1,74 @@
+import React from 'react';
+import ImmutablePropTypes from 'react-immutable-proptypes';
+import PropTypes from 'prop-types';
+import { injectIntl } from 'react-intl';
+import emojify from '../features/emoji/emoji';
+import classNames from 'classnames';
+
+class EmojiReactionButton extends React.PureComponent {
+
+ static propTypes = {
+ name: ImmutablePropTypes.map,
+ url: PropTypes.string,
+ staticUrl: PropTypes.string,
+ count: PropTypes.number.isRequired,
+ me: PropTypes.bool,
+ onClick: PropTypes.func,
+ };
+
+ render () {
+ const { name, url, staticUrl, count, me } = this.props;
+
+ let emojiHtml = null;
+ if (url) {
+ let customEmojis = {};
+ customEmojis[name] = { url, static_url: staticUrl };
+ emojiHtml = emojify(`:${name}:`, customEmojis);
+ } else {
+ emojiHtml = emojify(name);
+ }
+
+ const classList = {
+ 'emoji-reactions-bar__button': true,
+ 'toggled': me,
+ };
+
+ return (
+
+ );
+ }
+
+}
+
+class StatusEmojiReactionsBar extends React.PureComponent {
+
+ static propTypes = {
+ emojiReactions: ImmutablePropTypes.map.isRequired,
+ statusId: PropTypes.string,
+ };
+
+ render () {
+ const { emojiReactions, statusId } = this.props;
+
+ const emojiButtons = React.Children.map(emojiReactions, (emoji) => (
+ ));
+
+ return (
+
+ {emojiButtons}
+
+ );
+ }
+
+}
+export default injectIntl(StatusEmojiReactionsBar);
\ No newline at end of file
diff --git a/app/javascript/mastodon/features/status/components/detailed_status.jsx b/app/javascript/mastodon/features/status/components/detailed_status.jsx
index c81d83d71..9e4ac8980 100644
--- a/app/javascript/mastodon/features/status/components/detailed_status.jsx
+++ b/app/javascript/mastodon/features/status/components/detailed_status.jsx
@@ -6,6 +6,7 @@ import classNames from 'classnames';
import { Link, withRouter } from 'react-router-dom';
import ImmutablePropTypes from 'react-immutable-proptypes';
+import StatusEmojiReactionsBar from '../../../components/status_emoji_reactions_bar';
import ImmutablePureComponent from 'react-immutable-pure-component';
import { ReactComponent as AlternateEmailIcon } from '@material-symbols/svg-600/outlined/alternate_email.svg';
@@ -254,9 +255,14 @@ class DetailedStatus extends ImmutablePureComponent {
} else if (status.get('spoiler_text').length === 0) {
return ;
}
-
}
+ let emojiReactionsBar = null;
+ if (status.get('emoji_reactions')) {
+ const emojiReactions = status.get('emoji_reactions');
+ emojiReactionsBar = ;
+ }
+
if (status.get('application')) {
applicationLink = <> ยท {status.getIn(['application', 'name'])}>;
}
@@ -351,6 +357,8 @@ class DetailedStatus extends ImmutablePureComponent {
{expanded && hashtagBar}
+ {emojiReactionsBar}
+