mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-15 16:59:41 +00:00
[Glitch] Add hotkey Q for quoting the currently focused post
Port 229cbc6a24 to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
@@ -105,6 +105,7 @@ const hotkeyMatcherMap = {
|
||||
reply: just('r'),
|
||||
favourite: just('f'),
|
||||
boost: just('b'),
|
||||
quote: just('q'),
|
||||
mention: just('m'),
|
||||
open: any('enter', 'o'),
|
||||
openProfile: just('p'),
|
||||
|
||||
@@ -95,6 +95,7 @@ class Status extends ImmutablePureComponent {
|
||||
onReply: PropTypes.func,
|
||||
onFavourite: PropTypes.func,
|
||||
onReblog: PropTypes.func,
|
||||
onQuote: PropTypes.func,
|
||||
onBookmark: PropTypes.func,
|
||||
onDelete: PropTypes.func,
|
||||
onDirect: PropTypes.func,
|
||||
@@ -359,6 +360,10 @@ class Status extends ImmutablePureComponent {
|
||||
this.props.onBookmark(this.props.status, e);
|
||||
};
|
||||
|
||||
handleHotkeyQuote = () => {
|
||||
this.props.onQuote(this._properStatus());
|
||||
};
|
||||
|
||||
handleHotkeyMention = e => {
|
||||
e.preventDefault();
|
||||
this.props.onMention(this.props.status.get('account'));
|
||||
@@ -479,6 +484,7 @@ class Status extends ImmutablePureComponent {
|
||||
reply: this.handleHotkeyReply,
|
||||
favourite: this.handleHotkeyFavourite,
|
||||
boost: this.handleHotkeyBoost,
|
||||
quote: this.handleHotkeyQuote,
|
||||
mention: this.handleHotkeyMention,
|
||||
open: this.handleHotkeyOpen,
|
||||
openProfile: this.handleHotkeyOpenProfile,
|
||||
|
||||
@@ -59,6 +59,10 @@ const messages = defineMessages({
|
||||
defaultMessage: 'Private posts cannot be quoted',
|
||||
},
|
||||
reblog: { id: 'status.reblog', defaultMessage: 'Boost' },
|
||||
reblog_or_quote: {
|
||||
id: 'status.reblog_or_quote',
|
||||
defaultMessage: 'Boost or quote',
|
||||
},
|
||||
reblog_cancel: {
|
||||
id: 'status.cancel_reblog_private',
|
||||
defaultMessage: 'Unboost',
|
||||
@@ -176,7 +180,7 @@ export const StatusReblogButton: FC<ReblogButtonProps> = ({
|
||||
>
|
||||
<IconButton
|
||||
title={intl.formatMessage(
|
||||
!disabled ? messages.reblog : messages.all_disabled,
|
||||
!disabled ? messages.reblog_or_quote : messages.all_disabled,
|
||||
)}
|
||||
icon='retweet'
|
||||
iconComponent={iconComponent}
|
||||
|
||||
Reference in New Issue
Block a user