From 2d83d11558fd19c18fba4042c94657c3ef9f0bb5 Mon Sep 17 00:00:00 2001
From: Ivan Chen <ivan@tagg.id>
Date: Mon, 12 Apr 2021 17:28:38 -0400
Subject: added icons, fixed picker almost

---
 src/screens/chat/ChatScreen.tsx | 58 +++++++++++++++++++++--------------------
 1 file changed, 30 insertions(+), 28 deletions(-)

(limited to 'src/screens/chat/ChatScreen.tsx')

diff --git a/src/screens/chat/ChatScreen.tsx b/src/screens/chat/ChatScreen.tsx
index 02330527..9e75c581 100644
--- a/src/screens/chat/ChatScreen.tsx
+++ b/src/screens/chat/ChatScreen.tsx
@@ -1,6 +1,6 @@
 import {useBottomTabBarHeight} from '@react-navigation/bottom-tabs';
 import {StackNavigationProp} from '@react-navigation/stack';
-import React, {useContext} from 'react';
+import React, {useContext, useEffect} from 'react';
 import {StyleSheet} from 'react-native';
 import {SafeAreaView, useSafeAreaInsets} from 'react-native-safe-area-context';
 import {
@@ -8,10 +8,10 @@ import {
   Chat,
   MessageInput,
   MessageList,
-  OverlayProvider,
+  useAttachmentPickerContext,
 } from 'stream-chat-react-native';
 import {ChatContext} from '../../App';
-import {ChatInput, ChatHeader} from '../../components';
+import {ChatHeader, ChatInput} from '../../components';
 import {TAGG_LIGHT_BLUE} from '../../constants';
 import {MainStackParams} from '../../routes';
 import {ScreenType} from '../../types';
@@ -27,6 +27,7 @@ interface ChatScreenProps {
 const ChatScreen: React.FC<ChatScreenProps> = () => {
   const {channel, chatClient} = useContext(ChatContext);
   const tabbarHeight = useBottomTabBarHeight();
+  const {setTopInset} = useAttachmentPickerContext();
   const insets = useSafeAreaInsets();
 
   const chatTheme = {
@@ -37,32 +38,33 @@ const ChatScreen: React.FC<ChatScreenProps> = () => {
     },
   };
 
+  useEffect(() => {
+    setTopInset(insets.top + HeaderHeight);
+  });
+
   return (
-    <OverlayProvider
-      bottomInset={isIPhoneX() ? 80 : 50}
-      topInset={insets.top + HeaderHeight}>
-      <SafeAreaView
-        style={[
-          styles.container,
-          // unable to figure out the padding issue, a hacky solution
-          {paddingBottom: isIPhoneX() ? tabbarHeight + 20 : tabbarHeight + 50},
-        ]}>
-        <ChatHeader screenType={ScreenType.Chat} />
-        <Chat client={chatClient} style={chatTheme}>
-          <Channel
-            channel={channel}
-            keyboardVerticalOffset={0}
-            OverlayReactionList={() => null}
-            messageActions={({copyMessage, deleteMessage}) => [
-              copyMessage,
-              deleteMessage,
-            ]}>
-            <MessageList onThreadSelect={() => {}} />
-            <MessageInput Input={ChatInput} />
-          </Channel>
-        </Chat>
-      </SafeAreaView>
-    </OverlayProvider>
+    <SafeAreaView
+      style={[
+        styles.container,
+        // unable to figure out the padding issue, a hacky solution
+        {paddingBottom: isIPhoneX() ? tabbarHeight + 20 : tabbarHeight + 50},
+      ]}>
+      <ChatHeader screenType={ScreenType.Chat} />
+      <Chat client={chatClient} style={chatTheme}>
+        <Channel
+          channel={channel}
+          keyboardVerticalOffset={0}
+          OverlayReactionList={() => null}
+          messageActions={({copyMessage, deleteMessage}) => [
+            copyMessage,
+            deleteMessage,
+          ]}>
+          <MessageList onThreadSelect={() => {}} />
+          {/* <MessageInput /> */}
+          <MessageInput Input={ChatInput} />
+        </Channel>
+      </Chat>
+    </SafeAreaView>
   );
 };
 
-- 
cgit v1.2.3-70-g09d2

