|
|
|
@ -20,6 +20,8 @@ import {
|
|
|
|
|
unreblog,
|
|
|
|
|
pin,
|
|
|
|
|
unpin,
|
|
|
|
|
statusAddReaction,
|
|
|
|
|
statusRemoveReaction,
|
|
|
|
|
} from 'flavours/glitch/actions/interactions';
|
|
|
|
|
import {
|
|
|
|
|
replyCompose,
|
|
|
|
@ -56,6 +58,7 @@ import { autoUnfoldCW } from 'flavours/glitch/utils/content_warning';
|
|
|
|
|
import { textForScreenReader, defaultMediaVisibility } from 'flavours/glitch/components/status';
|
|
|
|
|
import Icon from 'flavours/glitch/components/icon';
|
|
|
|
|
import { Helmet } from 'react-helmet';
|
|
|
|
|
import buildCustomEmojiMap from '../../utils/emoji_map';
|
|
|
|
|
|
|
|
|
|
const messages = defineMessages({
|
|
|
|
|
deleteConfirm: { id: 'confirmations.delete.confirm', defaultMessage: 'Delete' },
|
|
|
|
@ -146,6 +149,7 @@ const makeMapStateToProps = () => {
|
|
|
|
|
askReplyConfirmation: state.getIn(['local_settings', 'confirm_before_clearing_draft']) && state.getIn(['compose', 'text']).trim().length !== 0,
|
|
|
|
|
domain: state.getIn(['meta', 'domain']),
|
|
|
|
|
usingPiP: state.get('picture_in_picture').statusId === props.params.statusId,
|
|
|
|
|
emojiMap: buildCustomEmojiMap(state),
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -291,6 +295,30 @@ class Status extends ImmutablePureComponent {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
handleReactionAdd = (statusId, name) => {
|
|
|
|
|
const { dispatch } = this.props;
|
|
|
|
|
const { signedIn } = this.context.identity;
|
|
|
|
|
|
|
|
|
|
if (signedIn) {
|
|
|
|
|
dispatch(statusAddReaction(statusId, name));
|
|
|
|
|
} else {
|
|
|
|
|
dispatch(openModal('INTERACTION', {
|
|
|
|
|
type: 'reaction_add',
|
|
|
|
|
accountId: status.getIn(['account', 'id']),
|
|
|
|
|
url: status.get('url'),
|
|
|
|
|
}));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
handleReactionRemove = (statusId, name) => {
|
|
|
|
|
const { dispatch } = this.props;
|
|
|
|
|
const { signedIn } = this.context.identity;
|
|
|
|
|
|
|
|
|
|
if (signedIn) {
|
|
|
|
|
dispatch(statusRemoveReaction(statusId, name));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
handlePin = (status) => {
|
|
|
|
|
if (status.get('pinned')) {
|
|
|
|
|
this.props.dispatch(unpin(status));
|
|
|
|
@ -676,6 +704,8 @@ class Status extends ImmutablePureComponent {
|
|
|
|
|
settings={settings}
|
|
|
|
|
onOpenVideo={this.handleOpenVideo}
|
|
|
|
|
onOpenMedia={this.handleOpenMedia}
|
|
|
|
|
onReactionAdd={this.handleReactionAdd}
|
|
|
|
|
onReactionRemove={this.handleReactionRemove}
|
|
|
|
|
expanded={isExpanded}
|
|
|
|
|
onToggleHidden={this.handleToggleHidden}
|
|
|
|
|
onTranslate={this.handleTranslate}
|
|
|
|
@ -683,6 +713,7 @@ class Status extends ImmutablePureComponent {
|
|
|
|
|
showMedia={this.state.showMedia}
|
|
|
|
|
onToggleMediaVisibility={this.handleToggleMediaVisibility}
|
|
|
|
|
usingPiP={usingPiP}
|
|
|
|
|
emojiMap={this.props.emojiMap}
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<ActionBar
|
|
|
|
|