kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
Add StatusInteractionBar
rodzic
6769b2d68c
commit
1b85b8e3f1
|
@ -0,0 +1,47 @@
|
||||||
|
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')) }} />
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -43,6 +43,7 @@ import { attachFullscreenListener, detachFullscreenListener, isFullscreen } from
|
||||||
import { textForScreenReader, defaultMediaVisibility } from '../../components/status';
|
import { textForScreenReader, defaultMediaVisibility } from '../../components/status';
|
||||||
import Icon from 'gabsocial/components/icon';
|
import Icon from 'gabsocial/components/icon';
|
||||||
import { getSettings } from 'gabsocial/actions/settings';
|
import { getSettings } from 'gabsocial/actions/settings';
|
||||||
|
import { StatusInteractionBar } from './components/status_interaction_bar';
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
deleteConfirm: { id: 'confirmations.delete.confirm', defaultMessage: 'Delete' },
|
deleteConfirm: { id: 'confirmations.delete.confirm', defaultMessage: 'Delete' },
|
||||||
|
@ -492,6 +493,8 @@ class Status extends ImmutablePureComponent {
|
||||||
onToggleMediaVisibility={this.handleToggleMediaVisibility}
|
onToggleMediaVisibility={this.handleToggleMediaVisibility}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<StatusInteractionBar status={status} />
|
||||||
|
|
||||||
<ActionBar
|
<ActionBar
|
||||||
status={status}
|
status={status}
|
||||||
onReply={this.handleReplyClick}
|
onReply={this.handleReplyClick}
|
||||||
|
|
Ładowanie…
Reference in New Issue