import {useBottomTabBarHeight} from '@react-navigation/bottom-tabs'; import {StackNavigationProp} from '@react-navigation/stack'; import React, {useContext} from 'react'; import {StyleSheet} from 'react-native'; import {SafeAreaView, useSafeAreaInsets} from 'react-native-safe-area-context'; import { Channel, Chat, MessageInput, MessageList, OverlayProvider, } from 'stream-chat-react-native'; import {ChatContext} from '../../App'; import ChatHeader from '../../components/messages/ChatHeader'; import {TAGG_LIGHT_BLUE} from '../../constants'; import {MainStackParams} from '../../routes'; import {ScreenType} from '../../types'; import {HeaderHeight, isIPhoneX, SCREEN_WIDTH} 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 insets = useSafeAreaInsets(); const chatTheme = { messageList: { container: { backgroundColor: 'white', }, }, }; return ( null} messageActions={({copyMessage, deleteMessage}) => [ copyMessage, deleteMessage, ]}> {}} /> ); }; const styles = StyleSheet.create({ container: { backgroundColor: 'white', flex: 1, }, submitButton: { height: 35, width: 35, backgroundColor: TAGG_LIGHT_BLUE, borderRadius: 999, justifyContent: 'center', alignItems: 'center', bottom: -5, alignSelf: 'flex-end', }, messageText: { width: 196, paddingHorizontal: 23, paddingTop: 7.35, paddingBottom: 12, }, mainBubbleContainer: { marginVertical: 1, width: SCREEN_WIDTH, flexDirection: 'row', }, mainOwnBubbleContainer: { justifyContent: 'flex-end', // Different marginTop: 22, }, mainUserXBubbleContainer: { justifyContent: 'flex-start', }, avatar: { width: 40, height: 40, borderRadius: 20, right: -19, zIndex: 1, position: 'absolute', top: 0, left: 0, }, ownBubbleContainer: {width: 241, marginBottom: 9}, ownBubble: { maxWidth: 270, backgroundColor: '#DEE6F4', borderColor: '#DEE6F4', borderWidth: 1, borderRadius: 10, alignSelf: 'center', }, userXBubble: { maxWidth: 235, backgroundColor: '#E4F0F2', borderColor: '#E4F0F2', borderWidth: 1, borderRadius: 10, zIndex: 0, alignSelf: 'flex-end', marginLeft: 25, marginTop: 14, }, }); export default ChatScreen;