0
0
Fork 0

Add dropdown for boost privacy in boost confirmation modal (#15704)

* Various dropdown code quality fixes

* Prepare support for privacy selection in boost modal

* Add dropdown for boost privacy in boost confirmation modal
This commit is contained in:
Claire 2021-02-11 00:53:12 +01:00 committed by GitHub
parent 8b8c6726ce
commit 07b46cb332
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 137 additions and 31 deletions

View file

@ -10,6 +10,7 @@ import { defineMessages, injectIntl } from 'react-intl';
import { replyCompose } from 'mastodon/actions/compose';
import { reblog, favourite, unreblog, unfavourite } from 'mastodon/actions/interactions';
import { makeGetStatus } from 'mastodon/selectors';
import { initBoostModal } from 'mastodon/actions/boosts';
import { openModal } from 'mastodon/actions/modal';
const messages = defineMessages({
@ -89,9 +90,9 @@ class Footer extends ImmutablePureComponent {
}
};
_performReblog = () => {
const { dispatch, status } = this.props;
dispatch(reblog(status));
_performReblog = (status, privacy) => {
const { dispatch } = this.props;
dispatch(reblog(status, privacy));
}
handleReblogClick = e => {
@ -100,9 +101,9 @@ class Footer extends ImmutablePureComponent {
if (status.get('reblogged')) {
dispatch(unreblog(status));
} else if ((e && e.shiftKey) || !boostModal) {
this._performReblog();
this._performReblog(status);
} else {
dispatch(openModal('BOOST', { status, onReblog: this._performReblog }));
dispatch(initBoostModal({ status, onReblog: this._performReblog }));
}
};