-
+
+
+
-
+
-
-
+
+
-
-
- {!standalone && }
-
+
+
+ {!standalone && }
+
-
- {children}
-
-
+
+ {children}
+
+
- {(me && !shouldHideFAB()) && (
-
-
-
- )}
+ {(me && !shouldHideFAB()) && (
+
+
+
+ )}
- {me && (
-
+ {me && (
+
+ {Component => }
+
+ )}
+
+ {me && features.chats && (
+
+ {Component => (
+
+
+
+ )}
+
+ )}
+
+
+
{Component => }
- )}
- {me && features.chats && (
-
- {Component => (
-
-
-
- )}
+
+ {Component => }
- )}
-
-
-
- {Component => }
-
-
-
- {Component => }
-
+
-
+
);
};
diff --git a/app/soapbox/features/ui/util/global-hotkeys.tsx b/app/soapbox/features/ui/util/global-hotkeys.tsx
index aeb4d42fb..e54528a58 100644
--- a/app/soapbox/features/ui/util/global-hotkeys.tsx
+++ b/app/soapbox/features/ui/util/global-hotkeys.tsx
@@ -36,9 +36,10 @@ const keyMap = {
interface IGlobalHotkeys {
children: React.ReactNode
+ node: React.MutableRefObject
}
-const GlobalHotkeys: React.FC = ({ children }) => {
+const GlobalHotkeys: React.FC = ({ children, node }) => {
const hotkeys = useRef(null);
const history = useHistory();
@@ -48,9 +49,9 @@ const GlobalHotkeys: React.FC = ({ children }) => {
const handleHotkeyNew = (e?: KeyboardEvent) => {
e?.preventDefault();
- if (!hotkeys.current) return;
+ if (!node.current) return;
- const element = hotkeys.current.querySelector('textarea#compose-textarea') as HTMLTextAreaElement;
+ const element = node.current.querySelector('textarea#compose-textarea') as HTMLTextAreaElement;
if (element) {
element.focus();
@@ -59,9 +60,9 @@ const GlobalHotkeys: React.FC = ({ children }) => {
const handleHotkeySearch = (e?: KeyboardEvent) => {
e?.preventDefault();
- if (!hotkeys.current) return;
+ if (!node.current) return;
- const element = hotkeys.current.querySelector('input#search') as HTMLInputElement;
+ const element = node.current.querySelector('input#search') as HTMLInputElement;
if (element) {
element.focus();