@@ -4,17 +4,16 @@ import {
44 Channel ,
55 MessageInput ,
66 useChatContext ,
7- MessageFlashList ,
87 ThreadContextValue ,
8+ MessageList ,
99} from 'stream-chat-expo' ;
1010import { Stack , useLocalSearchParams , useRouter } from 'expo-router' ;
1111import { AuthProgressLoader } from '../../../components/AuthProgressLoader' ;
1212import { AppContext } from '../../../context/AppContext' ;
1313import { useHeaderHeight } from '@react-navigation/elements' ;
1414import InputButtons from '../../../components/InputButtons' ;
1515import { MessageLocation } from '../../../components/LocationSharing/MessageLocation' ;
16- import { SafeAreaView } from 'react-native-safe-area-context' ;
17- import { StyleSheet } from 'react-native' ;
16+ import { Platform , StyleSheet , View } from 'react-native' ;
1817
1918export default function ChannelScreen ( ) {
2019 const { client } = useChatContext ( ) ;
@@ -67,26 +66,27 @@ export default function ChannelScreen() {
6766 }
6867
6968 return (
70- < SafeAreaView edges = { [ 'bottom' ] } style = { styles . container } >
69+ < View style = { styles . container } >
70+ < Stack . Screen
71+ options = { { title : 'Channel Screen' , contentStyle : { backgroundColor : 'white' } } }
72+ />
7173 < Channel
7274 audioRecordingEnabled = { true }
7375 channel = { channel }
7476 onPressMessage = { onPressMessage }
75- keyboardVerticalOffset = { headerHeight }
77+ keyboardVerticalOffset = { Platform . OS === 'ios' ? headerHeight : undefined }
7678 MessageLocation = { MessageLocation }
7779 thread = { thread }
7880 >
79- < Stack . Screen options = { { title : 'Channel Screen' } } />
80-
81- < MessageFlashList
81+ < MessageList
8282 onThreadSelect = { ( thread : ThreadContextValue [ 'thread' ] ) => {
8383 setThread ( thread ) ;
8484 router . push ( `/channel/${ channel . cid } /thread/${ thread ?. cid ?? '' } ` ) ;
8585 } }
8686 />
8787 < MessageInput InputButtons = { InputButtons } />
8888 </ Channel >
89- </ SafeAreaView >
89+ </ View >
9090 ) ;
9191}
9292
0 commit comments