quote action bar to detailed view

This commit is contained in:
2458773093
2019-08-01 16:05:59 +03:00
parent c876f90d54
commit 900342a251
2 changed files with 32 additions and 0 deletions

View File

@@ -21,6 +21,7 @@ import {
replyCompose,
mentionCompose,
directCompose,
quoteCompose,
} from '../../actions/compose';
import { blockAccount } from '../../actions/accounts';
import {
@@ -189,6 +190,24 @@ class Status extends ImmutablePureComponent {
}
}
handleQuoteClick = (status) => {
let { dispatch, intl } = this.props;
const router = this.context.router.history;
dispatch((_, getState) => {
let state = getState();
if (state.getIn(['compose', 'text']).trim().length !== 0) {
dispatch(openModal('CONFIRM', {
message: intl.formatMessage(messages.quoteMessage),
confirm: intl.formatMessage(messages.quoteConfirm),
onConfirm: () => dispatch(quoteCompose(status, router)),
}));
} else {
dispatch(quoteCompose(status, router));
}
});
}
handleModalReblog = (status) => {
this.props.dispatch(reblog(status));
}
@@ -489,6 +508,7 @@ class Status extends ImmutablePureComponent {
status={status}
onReply={this.handleReplyClick}
onFavourite={this.handleFavouriteClick}
onQuote={this.handleQuoteClick}
onReblog={this.handleReblogClick}
onDelete={this.handleDeleteClick}
onDirect={this.handleDirectClick}