about summary refs log tree commit diff
path: root/src/App.web.tsx
diff options
context:
space:
mode:
authorEric Bailey <git@esb.lol>2024-09-13 16:48:28 -0500
committerGitHub <noreply@github.com>2024-09-13 16:48:28 -0500
commitd76f9abdd718e24848a9b8f67486129aee421427 (patch)
treee5574c807eea6010746006a234e3a79dc0684552 /src/App.web.tsx
parentcac43127f0163c84a921afd806d91e1df10ea568 (diff)
downloadvoidsky-d76f9abdd718e24848a9b8f67486129aee421427.tar.zst
"N" keyboard shortcut to open a new post modal (#5197)
* feat: Add hook on web app to open composer with 'N' keyboard shortcut

* Extract, don't fire open composer if already open

* Ignore interactive elements

---------

Co-authored-by: João Gabriel <joaog@nocorp.io>
Co-authored-by: Hailey <me@haileyok.com>
Diffstat (limited to 'src/App.web.tsx')
-rw-r--r--src/App.web.tsx3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/App.web.tsx b/src/App.web.tsx
index bef320826..6efe7cc02 100644
--- a/src/App.web.tsx
+++ b/src/App.web.tsx
@@ -35,6 +35,7 @@ import {
 } from '#/state/session'
 import {readLastActiveAccount} from '#/state/session/util'
 import {Provider as ShellStateProvider} from '#/state/shell'
+import {useComposerKeyboardShortcut} from '#/state/shell/composer/useComposerKeyboardShortcut'
 import {Provider as LoggedOutViewProvider} from '#/state/shell/logged-out'
 import {Provider as ProgressGuideProvider} from '#/state/shell/progress-guide'
 import {Provider as SelectedFeedProvider} from '#/state/shell/selected-feed'
@@ -62,6 +63,8 @@ function InnerApp() {
   useIntentHandler()
   const hasCheckedReferrer = useStarterPackEntry()
 
+  useComposerKeyboardShortcut()
+
   // init
   useEffect(() => {
     async function onLaunch(account?: SessionAccount) {