diff options
Diffstat (limited to 'src/components/messages')
-rw-r--r-- | src/components/messages/ChatInput.tsx | 59 | ||||
-rw-r--r-- | src/components/messages/TypingIndicator.tsx | 3 |
2 files changed, 30 insertions, 32 deletions
diff --git a/src/components/messages/ChatInput.tsx b/src/components/messages/ChatInput.tsx index 005d4401..bde5fc12 100644 --- a/src/components/messages/ChatInput.tsx +++ b/src/components/messages/ChatInput.tsx @@ -1,12 +1,10 @@ import React from 'react'; import {Image, StyleSheet, View} from 'react-native'; import {TouchableOpacity} from 'react-native-gesture-handler'; -import ImagePicker from 'react-native-image-crop-picker'; import {useStore} from 'react-redux'; import { AutoCompleteInput, MessageInputProps, - useAttachmentPickerContext, useMessageInputContext, } from 'stream-chat-react-native'; import {RootState} from '../../store/rootReducer'; @@ -35,35 +33,35 @@ const ChatInput: React.FC< > = () => { const state: RootState = useStore().getState(); const avatar = state.user.avatar; - const {sendMessage, text, setText, uploadNewImage} = useMessageInputContext(); - const { - setSelectedImages, - selectedImages, - openPicker, - } = useAttachmentPickerContext(); + const {sendMessage, text, setText} = useMessageInputContext(); + // const { + // setSelectedImages, + // selectedImages, + // openPicker, + // } = useAttachmentPickerContext(); - const selectImage = () => { - ImagePicker.openPicker({ - cropping: true, - freeStyleCropEnabled: true, - mediaType: 'photo', - multiple: true, - // includeBase64: true, - }) - .then((pictures) => { - pictures.map((pic) => - uploadNewImage({ - width: pic.width, - height: pic.height, - source: 'picker', - uri: 'ph://' + pic.localIdentifier, - }), - ); - }) - .catch((error) => { - console.log(error); - }); - }; + // const selectImage = () => { + // ImagePicker.openPicker({ + // cropping: true, + // freeStyleCropEnabled: true, + // mediaType: 'photo', + // multiple: true, + // // includeBase64: true, + // }) + // .then((pictures) => { + // pictures.map((pic) => + // uploadNewImage({ + // width: pic.width, + // height: pic.height, + // source: 'picker', + // uri: 'ph://' + pic.localIdentifier, + // }), + // ); + // }) + // .catch((error) => { + // console.log(error); + // }); + // }; return ( <View style={styles.container}> @@ -139,7 +137,6 @@ const styles = StyleSheet.create({ marginRight: 10, width: 100, alignSelf: 'flex-end', - // borderWidth: 1, }, }); diff --git a/src/components/messages/TypingIndicator.tsx b/src/components/messages/TypingIndicator.tsx index be7141a2..b7c33567 100644 --- a/src/components/messages/TypingIndicator.tsx +++ b/src/components/messages/TypingIndicator.tsx @@ -7,7 +7,7 @@ const TypingIndicator: React.FC = () => { <View style={styles.typingIndicatorContainer}> <Image source={require('../../assets/gifs/loading-animation.gif')} - style={{width: 88, height: 49}} + style={styles.image} /> </View> ); @@ -25,6 +25,7 @@ const styles = StyleSheet.create({ justifyContent: 'center', alignItems: 'center', }, + image: {width: 88, height: 49}, }); export default TypingIndicator; |