Add reblog menu with force modal

This commit is contained in:
KMY 2023-05-18 12:25:56 +09:00
parent 3c2840510d
commit f832b5698a
7 changed files with 42 additions and 2 deletions

View file

@ -310,7 +310,7 @@ class Status extends ImmutablePureComponent {
this.props.dispatch(reblog(status, privacy));
};
handleReblogClick = (status, e) => {
handleReblogClick = (status, e, force = false) => {
const { dispatch } = this.props;
const { signedIn } = this.context.identity;
@ -318,7 +318,7 @@ class Status extends ImmutablePureComponent {
if (status.get('reblogged')) {
dispatch(unreblog(status));
} else {
if ((e && e.shiftKey) || !boostModal) {
if (!force && ((e && e.shiftKey) || !boostModal)) {
this.handleModalReblog(status);
} else {
dispatch(initBoostModal({ status, onReblog: this.handleModalReblog }));
@ -333,6 +333,10 @@ class Status extends ImmutablePureComponent {
}
};
handleReblogForceModalClick = (status, e) => {
this.handleReblogClick(status, e, true);
};
handleBookmarkClick = (status) => {
if (status.get('bookmarked')) {
this.props.dispatch(unbookmark(status));
@ -678,6 +682,7 @@ class Status extends ImmutablePureComponent {
onFavourite={this.handleFavouriteClick}
onEmojiReact={this.handleEmojiReact}
onReblog={this.handleReblogClick}
onReblogForceModal={this.handleReblogForceModalClick}
onBookmark={this.handleBookmarkClick}
onDelete={this.handleDeleteClick}
onEdit={this.handleEditClick}