about summary refs log tree commit diff
path: root/src/screens
diff options
context:
space:
mode:
authorSamuel Newman <mozzius@protonmail.com>2024-06-11 20:50:56 +0100
committerGitHub <noreply@github.com>2024-06-11 12:50:56 -0700
commit3d4b390a8a9c4a7c52354a0c7bd4bc0a8e12f9f8 (patch)
tree3ab59acd7cda6b1447df45d6e1518069fca985bb /src/screens
parentaca0fa23ec72d66c7de44c5079dae188221f0378 (diff)
downloadvoidsky-3d4b390a8a9c4a7c52354a0c7bd4bc0a8e12f9f8.tar.zst
Only enable keyboard controller when necessary (#4483)
* Only enable keyboard controller when necessary

* make it screen only

* rm keyboard padding

* rm keyboardpadding file

* revert using keyboard controller in composer

* remove styles.outer (unnecessary for revert)

* continue to use keyboard padding in the report dialog for dms

---------

Co-authored-by: Hailey <me@haileyok.com>
Diffstat (limited to 'src/screens')
-rw-r--r--src/screens/Messages/Conversation/index.tsx12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/screens/Messages/Conversation/index.tsx b/src/screens/Messages/Conversation/index.tsx
index d21887de3..a99ef8d4d 100644
--- a/src/screens/Messages/Conversation/index.tsx
+++ b/src/screens/Messages/Conversation/index.tsx
@@ -1,5 +1,6 @@
 import React, {useCallback} from 'react'
 import {View} from 'react-native'
+import {useKeyboardController} from 'react-native-keyboard-controller'
 import {AppBskyActorDefs, moderateProfile, ModerationOpts} from '@atproto/api'
 import {msg} from '@lingui/macro'
 import {useLingui} from '@lingui/react'
@@ -34,6 +35,17 @@ export function MessagesConversationScreen({route}: Props) {
   const convoId = route.params.conversation
   const {setCurrentConvoId} = useCurrentConvoId()
 
+  const {setEnabled} = useKeyboardController()
+  useFocusEffect(
+    useCallback(() => {
+      if (isWeb) return
+      setEnabled(true)
+      return () => {
+        setEnabled(false)
+      }
+    }, [setEnabled]),
+  )
+
   useFocusEffect(
     useCallback(() => {
       setCurrentConvoId(convoId)