@@ -4,7 +4,6 @@ import { TouchableOpacity } from 'react-native-gesture-handler';
44import { useNavigation } from '@react-navigation/core' ;
55
66import {
7- DefaultStreamChatGenerics ,
87 MessageInputContextValue ,
98 Search ,
109 SendRight ,
@@ -16,20 +15,15 @@ import {
1615
1716import { NewDirectMessagingScreenNavigationProp } from '../screens/NewDirectMessagingScreen' ;
1817
19- import { StreamChatGenerics as LocalStreamChatGenerics } from '../types' ;
2018import { useUserSearchContext } from '../context/UserSearchContext' ;
2119import { useAppContext } from '../context/AppContext' ;
2220
23- type NewDirectMessagingSendButtonPropsWithContext <
24- StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics ,
25- > = Pick < MessageInputContextValue < StreamChatGenerics > , 'giphyActive' | 'sendMessage' > & {
21+ type NewDirectMessagingSendButtonPropsWithContext = Pick < MessageInputContextValue , 'giphyActive' | 'sendMessage' > & {
2622 /** Disables the button */ disabled : boolean ;
2723} ;
2824
29- const SendButtonWithContext = <
30- StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics ,
31- > (
32- props : NewDirectMessagingSendButtonPropsWithContext < StreamChatGenerics > ,
25+ const SendButtonWithContext = (
26+ props : NewDirectMessagingSendButtonPropsWithContext ,
3327) => {
3428 const { disabled = false , giphyActive, sendMessage } = props ;
3529 const {
@@ -53,9 +47,9 @@ const SendButtonWithContext = <
5347 ) ;
5448} ;
5549
56- const areEqual = < StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics > (
57- prevProps : NewDirectMessagingSendButtonPropsWithContext < StreamChatGenerics > ,
58- nextProps : NewDirectMessagingSendButtonPropsWithContext < StreamChatGenerics > ,
50+ const areEqual = (
51+ prevProps : NewDirectMessagingSendButtonPropsWithContext ,
52+ nextProps : NewDirectMessagingSendButtonPropsWithContext ,
5953) => {
6054 const {
6155 disabled : prevDisabled ,
@@ -91,20 +85,18 @@ const MemoizedNewDirectMessagingSendButton = React.memo(
9185 areEqual ,
9286) as typeof SendButtonWithContext ;
9387
94- export type SendButtonProps <
95- StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics ,
96- > = Partial < NewDirectMessagingSendButtonPropsWithContext < StreamChatGenerics > > ;
88+ export type SendButtonProps = Partial < NewDirectMessagingSendButtonPropsWithContext > ;
9789
9890/**
9991 * UI Component for send button in MessageInput component.
10092 */
101- export const NewDirectMessagingSendButton = ( props : SendButtonProps < LocalStreamChatGenerics > ) => {
93+ export const NewDirectMessagingSendButton = ( props : SendButtonProps ) => {
10294 const { chatClient } = useAppContext ( ) ;
10395 const navigation = useNavigation < NewDirectMessagingScreenNavigationProp > ( ) ;
104- const { channel } = useChannelContext < LocalStreamChatGenerics > ( ) ;
96+ const { channel } = useChannelContext ( ) ;
10597 const { selectedUserIds, reset } = useUserSearchContext ( ) ;
10698
107- const { giphyActive, text } = useMessageInputContext < LocalStreamChatGenerics > ( ) ;
99+ const { giphyActive, text } = useMessageInputContext ( ) ;
108100
109101 const sendMessage = async ( ) => {
110102 if ( ! channel ) {
@@ -133,7 +125,7 @@ export const NewDirectMessagingSendButton = (props: SendButtonProps<LocalStreamC
133125 } ;
134126
135127 return (
136- < MemoizedNewDirectMessagingSendButton < LocalStreamChatGenerics >
128+ < MemoizedNewDirectMessagingSendButton
137129 { ...{ giphyActive, sendMessage } }
138130 { ...props }
139131 { ...{ disabled : props . disabled || false } }
0 commit comments