about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/features/account_timeline/containers
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2019-03-26 17:34:02 +0100
committerThibaut Girka <thib@sitedethib.com>2019-03-26 17:44:00 +0100
commit9e80b34a95c39d0a1a944713f0f4d6cc5e8b8c43 (patch)
tree9952f2e08780455dc1af0febe4b374f5b8a60e2e /app/javascript/flavours/glitch/features/account_timeline/containers
parentfae53e1a39209726d74b5ac93c863f98d4e73f26 (diff)
[Glitch] Add a “Block & Report” button to the block confirmation dialog
Port 6df4a8296996181d56a22535b86830c0ab56086e to glitch-soc
Diffstat (limited to 'app/javascript/flavours/glitch/features/account_timeline/containers')
-rw-r--r--app/javascript/flavours/glitch/features/account_timeline/containers/header_container.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/javascript/flavours/glitch/features/account_timeline/containers/header_container.js b/app/javascript/flavours/glitch/features/account_timeline/containers/header_container.js
index e333c31a1..df74ca890 100644
--- a/app/javascript/flavours/glitch/features/account_timeline/containers/header_container.js
+++ b/app/javascript/flavours/glitch/features/account_timeline/containers/header_container.js
@@ -26,6 +26,7 @@ const messages = defineMessages({
   unfollowConfirm: { id: 'confirmations.unfollow.confirm', defaultMessage: 'Unfollow' },
   blockConfirm: { id: 'confirmations.block.confirm', defaultMessage: 'Block' },
   blockDomainConfirm: { id: 'confirmations.domain_block.confirm', defaultMessage: 'Hide entire domain' },
+  blockAndReport: { id: 'confirmations.block.block_and_report', defaultMessage: 'Block & Report' },
 });
 
 const makeMapStateToProps = () => {
@@ -64,6 +65,11 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
         message: <FormattedMessage id='confirmations.block.message' defaultMessage='Are you sure you want to block {name}?' values={{ name: <strong>@{account.get('acct')}</strong> }} />,
         confirm: intl.formatMessage(messages.blockConfirm),
         onConfirm: () => dispatch(blockAccount(account.get('id'))),
+        secondary: intl.formatMessage(messages.blockAndReport),
+        onSecondary: () => {
+          dispatch(blockAccount(account.get('id')));
+          dispatch(initReport(account));
+        },
       }));
     }
   },