@@ -377,7 +389,12 @@ class ActionBar extends React.PureComponent {
onMouseLeave={this.handleLikeButtonLeave}
ref={this.setRef}
>
-
+
+
{shareButton}
@@ -400,4 +425,5 @@ class ActionBar extends React.PureComponent {
}
-export default injectIntl(connect(mapStateToProps, mapDispatchToProps)(ActionBar));
+export default injectIntl(
+ connect(mapStateToProps, mapDispatchToProps)(ActionBar));
diff --git a/app/soapbox/features/status/index.js b/app/soapbox/features/status/index.js
index 08135b7f9..0ecf98e8c 100644
--- a/app/soapbox/features/status/index.js
+++ b/app/soapbox/features/status/index.js
@@ -146,6 +146,7 @@ class Status extends ImmutablePureComponent {
fullscreen: false,
showMedia: defaultMediaVisibility(this.props.status, this.props.displayMedia),
loadedStatusId: undefined,
+ emojiSelectorFocused: false,
};
componentDidMount() {
@@ -363,6 +364,10 @@ class Status extends ImmutablePureComponent {
this.handleToggleMediaVisibility();
}
+ handleHotkeyReact = () => {
+ this._expandEmojiSelector();
+ }
+
handleMoveUp = id => {
const { status, ancestorsIds, descendantsIds } = this.props;
@@ -397,6 +402,23 @@ class Status extends ImmutablePureComponent {
}
}
+ handleEmojiSelectorExpand = e => {
+ if (e.key === 'Enter') {
+ this._expandEmojiSelector();
+ }
+ e.preventDefault();
+ }
+
+ handleEmojiSelectorUnfocus = () => {
+ this.setState({ emojiSelectorFocused: false });
+ }
+
+ _expandEmojiSelector = () => {
+ this.setState({ emojiSelectorFocused: true });
+ const firstEmoji = this.status.querySelector('.emoji-react-selector .emoji-react-selector__emoji');
+ firstEmoji.focus();
+ };
+
_selectChild(index, align_top) {
const container = this.node;
const element = container.querySelectorAll('.focusable')[index];
@@ -445,6 +467,10 @@ class Status extends ImmutablePureComponent {
this.node = c;
}
+ setStatusRef = c => {
+ this.status = c;
+ }
+
componentDidUpdate(prevProps, prevState) {
const { params, status } = this.props;
const { ancestorsIds } = prevProps;
@@ -510,6 +536,7 @@ class Status extends ImmutablePureComponent {
openProfile: this.handleHotkeyOpenProfile,
toggleHidden: this.handleHotkeyToggleHidden,
toggleSensitive: this.handleHotkeyToggleSensitive,
+ react: this.handleHotkeyReact,
};
return (
@@ -537,7 +564,7 @@ class Status extends ImmutablePureComponent {
{ancestors}
-
+
diff --git a/app/soapbox/features/ui/components/hotkeys_modal.js b/app/soapbox/features/ui/components/hotkeys_modal.js
index 319e2e0e5..c646a0923 100644
--- a/app/soapbox/features/ui/components/hotkeys_modal.js
+++ b/app/soapbox/features/ui/components/hotkeys_modal.js
@@ -49,6 +49,10 @@ class HotkeysModal extends ImmutablePureComponent {
f |
|
+
+ e |
+ |
+
b |
|
diff --git a/app/soapbox/features/ui/index.js b/app/soapbox/features/ui/index.js
index 2837cd902..fe6745b69 100644
--- a/app/soapbox/features/ui/index.js
+++ b/app/soapbox/features/ui/index.js
@@ -130,6 +130,7 @@ const keyMap = {
forceNew: 'option+n',
reply: 'r',
favourite: 'f',
+ react: 'e',
boost: 'b',
mention: 'm',
open: ['enter', 'o'],
diff --git a/app/soapbox/locales/pl.json b/app/soapbox/locales/pl.json
index 28d24c990..b968895d7 100644
--- a/app/soapbox/locales/pl.json
+++ b/app/soapbox/locales/pl.json
@@ -403,6 +403,7 @@
"keyboard_shortcuts.notifications": "aby otworzyć kolumnę powiadomień",
"keyboard_shortcuts.pinned": "aby przejść do listy przypiętych wpisów",
"keyboard_shortcuts.profile": "aby przejść do profilu autora wpisu",
+ "keyboard_shortcuts.react": "aby zareagować na wpis",
"keyboard_shortcuts.reply": "aby odpowiedzieć",
"keyboard_shortcuts.requests": "aby przejść do listy próśb o możliwość śledzenia",
"keyboard_shortcuts.search": "aby przejść do pola wyszukiwania",
@@ -707,6 +708,7 @@
"status.reactions.like": "Lubię",
"status.reactions.open_mouth": "Wow",
"status.reactions.weary": "Nuda…",
+ "status.reactions_expand": "Wybierz emoji",
"status.read_more": "Czytaj dalej",
"status.reblog": "Podbij",
"status.reblog_private": "Podbij dla odbiorców oryginalnego wpisu",
diff --git a/app/styles/components/detailed-status.scss b/app/styles/components/detailed-status.scss
index 985f1a079..3daac0805 100644
--- a/app/styles/components/detailed-status.scss
+++ b/app/styles/components/detailed-status.scss
@@ -94,6 +94,22 @@
transform: translateY(-1px);
}
}
+
+ .emoji-picker-expand {
+ display: none;
+ }
+
+ &:focus-within {
+ .emoji-picker-expand {
+ display: inline-flex;
+ width: 0;
+ overflow: hidden;
+
+ &:focus-within {
+ width: unset;
+ }
+ }
+ }
}
.detailed-status__wrapper {
diff --git a/app/styles/components/emoji-reacts.scss b/app/styles/components/emoji-reacts.scss
index d9a4450c7..9b2311099 100644
--- a/app/styles/components/emoji-reacts.scss
+++ b/app/styles/components/emoji-reacts.scss
@@ -80,7 +80,8 @@
transition: 0.1s;
z-index: 999;
- &--visible {
+ &--visible,
+ &--focused {
opacity: 1;
pointer-events: all;
}
@@ -99,7 +100,8 @@
transition: 0.1s;
}
- &:hover {
+ &:hover,
+ &:focus {
img {
width: 36px;
height: 36px;
diff --git a/app/styles/components/status.scss b/app/styles/components/status.scss
index 8c640e4d1..359ed2999 100644
--- a/app/styles/components/status.scss
+++ b/app/styles/components/status.scss
@@ -677,3 +677,22 @@ a.status-card.compact:hover {
border-radius: 4px;
}
}
+
+.status__action-bar,
+.detailed-status__action-bar {
+ .emoji-picker-expand {
+ display: none;
+ }
+
+ &:focus-within {
+ .emoji-picker-expand {
+ display: inline-flex;
+ width: 0;
+ overflow: hidden;
+
+ &:focus-within {
+ width: unset;
+ }
+ }
+ }
+}