@@ -3,7 +3,7 @@ import { I18nManager, LogBox, Platform, SafeAreaView, useColorScheme, View } fro
33import { DarkTheme , DefaultTheme , NavigationContainer , RouteProp } from '@react-navigation/native' ;
44import { createStackNavigator , StackNavigationProp } from '@react-navigation/stack' ;
55import { useHeaderHeight } from '@react-navigation/elements' ;
6- import { SafeAreaProvider , useSafeAreaInsets } from 'react-native-safe-area-context' ;
6+ import { SafeAreaProvider } from 'react-native-safe-area-context' ;
77import { Channel as ChannelType , ChannelSort } from 'stream-chat' ;
88import {
99 Channel ,
@@ -16,7 +16,6 @@ import {
1616 Streami18n ,
1717 Thread ,
1818 ThreadContextValue ,
19- useAttachmentPickerContext ,
2019 useCreateChatClient ,
2120 useOverlayContext ,
2221} from 'stream-chat-react-native' ;
@@ -53,11 +52,7 @@ const filters = {
5352 type : 'messaging' ,
5453} ;
5554
56- const sort : ChannelSort = [
57- { pinned_at : - 1 } ,
58- { last_message_at : - 1 } ,
59- { updated_at : - 1 } ,
60- ] ;
55+ const sort : ChannelSort = [ { pinned_at : - 1 } , { last_message_at : - 1 } , { updated_at : - 1 } ] ;
6156
6257/**
6358 * Start playing with streami18n instance here:
@@ -100,7 +95,6 @@ const EmptyHeader = () => <></>;
10095const ChannelScreen : React . FC < ChannelScreenProps > = ( { navigation } ) => {
10196 const { channel, setThread, thread } = useContext ( AppContext ) ;
10297 const headerHeight = useHeaderHeight ( ) ;
103- const { setTopInset } = useAttachmentPickerContext ( ) ;
10498 const { overlay } = useOverlayContext ( ) ;
10599
106100 useEffect ( ( ) => {
@@ -109,10 +103,6 @@ const ChannelScreen: React.FC<ChannelScreenProps> = ({ navigation }) => {
109103 } ) ;
110104 } , [ overlay , navigation ] ) ;
111105
112- useEffect ( ( ) => {
113- setTopInset ( headerHeight ) ;
114- } , [ headerHeight , setTopInset ] ) ;
115-
116106 if ( channel === undefined ) {
117107 return null ;
118108 }
@@ -193,16 +183,13 @@ const Stack = createStackNavigator<NavigationParamsList>();
193183type AppContextType = {
194184 channel : ChannelType | undefined ;
195185 setChannel : React . Dispatch < React . SetStateAction < ChannelType | undefined > > ;
196- setThread : React . Dispatch <
197- React . SetStateAction < ThreadContextValue [ 'thread' ] | undefined >
198- > ;
186+ setThread : React . Dispatch < React . SetStateAction < ThreadContextValue [ 'thread' ] | undefined > > ;
199187 thread : ThreadContextValue [ 'thread' ] | undefined ;
200188} ;
201189
202190const AppContext = React . createContext ( { } as AppContextType ) ;
203191
204192const App = ( ) => {
205- const { bottom } = useSafeAreaInsets ( ) ;
206193 const theme = useStreamChatTheme ( ) ;
207194 const { channel } = useContext ( AppContext ) ;
208195
@@ -217,11 +204,7 @@ const App = () => {
217204 }
218205
219206 return (
220- < OverlayProvider
221- bottomInset = { bottom }
222- i18nInstance = { streami18n }
223- value = { { style : theme } }
224- >
207+ < OverlayProvider i18nInstance = { streami18n } value = { { style : theme } } >
225208 < Chat client = { chatClient } i18nInstance = { streami18n } enableOfflineSupport >
226209 < Stack . Navigator
227210 initialRouteName = 'ChannelList'
0 commit comments