diff --git a/app/soapbox/actions/compose.js b/app/soapbox/actions/compose.js
index 86af6f5c1..4eca355d4 100644
--- a/app/soapbox/actions/compose.js
+++ b/app/soapbox/actions/compose.js
@@ -27,6 +27,8 @@ export const COMPOSE_SUBMIT_SUCCESS = 'COMPOSE_SUBMIT_SUCCESS';
export const COMPOSE_SUBMIT_FAIL = 'COMPOSE_SUBMIT_FAIL';
export const COMPOSE_REPLY = 'COMPOSE_REPLY';
export const COMPOSE_REPLY_CANCEL = 'COMPOSE_REPLY_CANCEL';
+export const COMPOSE_QUOTE = 'COMPOSE_QUOTE';
+export const COMPOSE_QUOTE_CANCEL = 'COMPOSE_QUOTE_CANCEL';
export const COMPOSE_DIRECT = 'COMPOSE_DIRECT';
export const COMPOSE_MENTION = 'COMPOSE_MENTION';
export const COMPOSE_RESET = 'COMPOSE_RESET';
@@ -119,6 +121,29 @@ export function cancelReplyCompose() {
};
}
+export function quoteCompose(status, routerHistory) {
+ return (dispatch, getState) => {
+ const state = getState();
+ const instance = state.get('instance');
+ const { explicitAddressing } = getFeatures(instance);
+
+ dispatch({
+ type: COMPOSE_QUOTE,
+ status: status,
+ account: state.getIn(['accounts', state.get('me')]),
+ explicitAddressing,
+ });
+
+ dispatch(openModal('COMPOSE'));
+ };
+}
+
+export function cancelQuoteCompose() {
+ return {
+ type: COMPOSE_QUOTE_CANCEL,
+ };
+}
+
export function resetCompose() {
return {
type: COMPOSE_RESET,
@@ -226,6 +251,7 @@ export function submitCompose(routerHistory, force = false) {
const params = {
status,
in_reply_to_id: state.getIn(['compose', 'in_reply_to'], null),
+ quote_id: state.getIn(['compose', 'quote'], null),
media_ids: media.map(item => item.get('id')),
sensitive: state.getIn(['compose', 'sensitive']),
spoiler_text: state.getIn(['compose', 'spoiler_text'], ''),
diff --git a/app/soapbox/components/modal_root.js b/app/soapbox/components/modal_root.js
index 220d22f61..3b622e3e0 100644
--- a/app/soapbox/components/modal_root.js
+++ b/app/soapbox/components/modal_root.js
@@ -18,6 +18,7 @@ const checkComposeContent = compose => {
compose.get('spoiler_text').length > 0,
compose.get('media_attachments').size > 0,
compose.get('in_reply_to') !== null,
+ compose.get('quote') !== null,
compose.get('poll') !== null,
].some(check => check === true);
};
diff --git a/app/soapbox/components/status.js b/app/soapbox/components/status.js
index 5637061e2..06285a8f4 100644
--- a/app/soapbox/components/status.js
+++ b/app/soapbox/components/status.js
@@ -10,7 +10,7 @@ import { Link, NavLink } from 'react-router-dom';
import HoverRefWrapper from 'soapbox/components/hover_ref_wrapper';
import Icon from 'soapbox/components/icon';
import PlaceholderCard from 'soapbox/features/placeholder/components/placeholder_card';
-import QuotedStatus from 'soapbox/features/status/components/quoted_status';
+import QuotedStatus from 'soapbox/features/status/containers/quoted_status_container';
import { getDomain } from 'soapbox/utils/accounts';
import Card from '../features/status/components/card';
@@ -71,6 +71,7 @@ class Status extends ImmutablePureComponent {
onReply: PropTypes.func,
onFavourite: PropTypes.func,
onReblog: PropTypes.func,
+ onQuote: PropTypes.func,
onDelete: PropTypes.func,
onDirect: PropTypes.func,
onChat: PropTypes.func,
diff --git a/app/soapbox/components/status_action_bar.js b/app/soapbox/components/status_action_bar.js
index 92e700820..327faf53d 100644
--- a/app/soapbox/components/status_action_bar.js
+++ b/app/soapbox/components/status_action_bar.js
@@ -78,6 +78,7 @@ class StatusActionBar extends ImmutablePureComponent {
onFavourite: PropTypes.func,
onBookmark: PropTypes.func,
onReblog: PropTypes.func,
+ onQuote: PropTypes.func,
onDelete: PropTypes.func,
onDirect: PropTypes.func,
onChat: PropTypes.func,
@@ -203,6 +204,15 @@ class StatusActionBar extends ImmutablePureComponent {
}
}
+ handleQuoteClick = () => {
+ const { me, onQuote, onOpenUnauthorizedModal, status } = this.props;
+ if (me) {
+ onQuote(status, this.context.router.history);
+ } else {
+ onOpenUnauthorizedModal('REBLOG');
+ }
+ }
+
handleDeleteClick = () => {
this.props.onDelete(this.props.status, this.context.router.history);
}
@@ -557,6 +567,9 @@ class StatusActionBar extends ImmutablePureComponent {