import {useBottomTabBarHeight} from '@react-navigation/bottom-tabs'; import {StackNavigationProp} from '@react-navigation/stack'; import React, {useContext, useEffect} from 'react'; import {StyleSheet} from 'react-native'; import {SafeAreaView, useSafeAreaInsets} from 'react-native-safe-area-context'; import { Channel, Chat, MessageInput, MessageList, useAttachmentPickerContext, } from 'stream-chat-react-native'; import {ChatContext} from '../../App'; import {ChatHeader, ChatInput, TabsGradient} from '../../components'; import {MainStackParams} from '../../routes'; import {ScreenType} from '../../types'; import {HeaderHeight, isIPhoneX} from '../../utils'; type ChatScreenNavigationProp = StackNavigationProp; interface ChatScreenProps { navigation: ChatScreenNavigationProp; } /* * Screen that displays all of the user's active conversations. */ const ChatScreen: React.FC = () => { const {channel, chatClient} = useContext(ChatContext); const tabbarHeight = useBottomTabBarHeight(); const {setTopInset} = useAttachmentPickerContext(); const insets = useSafeAreaInsets(); const chatTheme = { messageList: { container: { backgroundColor: 'white', }, }, messageInput: { container: { backgroundColor: '#f8f8f8', height: 70, }, }, }; useEffect(() => { setTopInset(insets.top + HeaderHeight); }); return ( null} messageActions={({copyMessage, deleteMessage}) => [ copyMessage, deleteMessage, ]}> {}} /> {/* */} ); }; const styles = StyleSheet.create({ container: { backgroundColor: 'white', flex: 1, }, }); export default ChatScreen;