@@ -27,6 +27,7 @@ import { useCreateInputMessageInputContext } from './hooks/useCreateInputMessage
2727import { useCreateMessagesContext } from './hooks/useCreateMessagesContext' ;
2828import { useCreatePaginatedMessageListContext } from './hooks/useCreatePaginatedMessageListContext' ;
2929import { useCreateThreadContext } from './hooks/useCreateThreadContext' ;
30+ import { useCreateTypingContext } from './hooks/useCreateTypingContext' ;
3031import { useTargetedMessage } from './hooks/useTargetedMessage' ;
3132import { heavyDebounce } from './utils/debounce' ;
3233import { lightThrottle } from './utils/throttle' ;
@@ -111,6 +112,10 @@ import {
111112 TranslationContextValue ,
112113 useTranslationContext ,
113114} from '../../contexts/translationContext/TranslationContext' ;
115+ import {
116+ TypingContextValue ,
117+ TypingProvider ,
118+ } from '../../contexts/typingContext/TypingContext' ;
114119import {
115120 LOLReaction ,
116121 LoveReaction ,
@@ -188,6 +193,7 @@ export type ChannelPropsWithContext<
188193 | 'EmptyStateIndicator'
189194 | 'enforceUniqueReaction'
190195 | 'giphyEnabled'
196+ | 'hideDateSeparators'
191197 | 'LoadingIndicator'
192198 | 'NetworkDownIndicator'
193199 | 'StickyHeader'
@@ -442,6 +448,7 @@ const ChannelWithContext = <
442448 hasCommands = true ,
443449 hasFilePicker = true ,
444450 hasImagePicker = true ,
451+ hideDateSeparators = false ,
445452 ImageUploadPreview = ImageUploadPreviewDefault ,
446453 initialScrollToFirstUnreadMessage = false ,
447454 initialValue,
@@ -547,7 +554,7 @@ const ChannelWithContext = <
547554 ThreadContextValue < At , Ch , Co , Ev , Me , Re , Us > [ 'threadMessages' ]
548555 > ( ( threadProps ?. id && channel ?. state ?. threads ?. [ threadProps . id ] ) || [ ] ) ;
549556 const [ typing , setTyping ] = useState <
550- ChannelContextValue < At , Ch , Co , Ev , Me , Re , Us > [ 'typing' ]
557+ TypingContextValue < At , Ch , Co , Ev , Me , Re , Us > [ 'typing' ]
551558 > ( { } ) ;
552559 const [ watcherCount , setWatcherCount ] = useState <
553560 ChannelContextValue < At , Ch , Co , Ev , Me , Re , Us > [ 'watcherCount' ]
@@ -1440,6 +1447,7 @@ const ChannelWithContext = <
14401447 ! ! ( channel ?. getConfig ?.( ) ?. commands || [ ] ) ?. some (
14411448 ( command ) => command . name === 'giphy' ,
14421449 ) ,
1450+ hideDateSeparators,
14431451 isAdmin,
14441452 isModerator,
14451453 isOwner,
@@ -1457,7 +1465,6 @@ const ChannelWithContext = <
14571465 setTargetedMessage,
14581466 StickyHeader,
14591467 targetedMessage,
1460- typing,
14611468 watcherCount,
14621469 watchers,
14631470 } ) ;
@@ -1607,6 +1614,10 @@ const ChannelWithContext = <
16071614 threadMessages,
16081615 } ) ;
16091616
1617+ const typingContext = useCreateTypingContext ( {
1618+ typing,
1619+ } ) ;
1620+
16101621 if ( ! channel || error ) {
16111622 return (
16121623 < LoadingErrorIndicator
@@ -1638,21 +1649,25 @@ const ChannelWithContext = <
16381649 { ...additionalKeyboardAvoidingViewProps }
16391650 >
16401651 < ChannelProvider < At , Ch , Co , Ev , Me , Re , Us > value = { channelContext } >
1641- < PaginatedMessageListProvider < At , Ch , Co , Ev , Me , Re , Us >
1642- value = { messageListContext }
1643- >
1644- < MessagesProvider < At , Ch , Co , Ev , Me , Re , Us > value = { messagesContext } >
1645- < ThreadProvider < At , Ch , Co , Ev , Me , Re , Us > value = { threadContext } >
1646- < SuggestionsProvider < Co , Us > value = { suggestionsContext } >
1647- < MessageInputProvider < At , Ch , Co , Ev , Me , Re , Us >
1648- value = { messageInputContext }
1649- >
1650- < View style = { { height : '100%' } } > { children } </ View >
1651- </ MessageInputProvider >
1652- </ SuggestionsProvider >
1653- </ ThreadProvider >
1654- </ MessagesProvider >
1655- </ PaginatedMessageListProvider >
1652+ < TypingProvider < At , Ch , Co , Ev , Me , Re , Us > value = { typingContext } >
1653+ < PaginatedMessageListProvider < At , Ch , Co , Ev , Me , Re , Us >
1654+ value = { messageListContext }
1655+ >
1656+ < MessagesProvider < At , Ch , Co , Ev , Me , Re , Us >
1657+ value = { messagesContext }
1658+ >
1659+ < ThreadProvider < At , Ch , Co , Ev , Me , Re , Us > value = { threadContext } >
1660+ < SuggestionsProvider < Co , Us > value = { suggestionsContext } >
1661+ < MessageInputProvider < At , Ch , Co , Ev , Me , Re , Us >
1662+ value = { messageInputContext }
1663+ >
1664+ < View style = { { height : '100%' } } > { children } </ View >
1665+ </ MessageInputProvider >
1666+ </ SuggestionsProvider >
1667+ </ ThreadProvider >
1668+ </ MessagesProvider >
1669+ </ PaginatedMessageListProvider >
1670+ </ TypingProvider >
16561671 </ ChannelProvider >
16571672 </ KeyboardCompatibleView >
16581673 ) ;
0 commit comments