Skip to content

Instantly share code, notes, and snippets.

@vishalnarkhede
Last active April 7, 2020 13:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vishalnarkhede/8ce5dec78730ab283c74bfa4ce9cfee9 to your computer and use it in GitHub Desktop.
Save vishalnarkhede/8ce5dec78730ab283c74bfa4ce9cfee9 to your computer and use it in GitHub Desktop.
import React from 'react';
import {TouchableOpacity, View, Text, StyleSheet} from 'react-native';
import {
AutoCompleteInput,
AttachButton,
SendButton,
} from 'stream-chat-react-native';
export const InputBox = props => {
return (
<View style={styles.container}>
<AutoCompleteInput {...props} />
<View style={styles.actionsContainer}>
<View style={styles.row}>
<TouchableOpacity
onPress={() => {
props.appendText('@');
}}>
<Text style={styles.textActionLabel}>@</Text>
</TouchableOpacity>
{/* Text editor is not functional yet. We will cover it in some future tutorials */}
<TouchableOpacity style={styles.textEditorContainer}>
<Text style={styles.textActionLabel}>Aa</Text>
</TouchableOpacity>
</View>
<View style={styles.row}>
<AttachButton {...props} />
<SendButton {...props} />
</View>
</View>
</View>
);
};
const styles = StyleSheet.create({
container: {
flexDirection: 'column',
flex: 1,
height: 60,
},
actionsContainer: {flexDirection: 'row', justifyContent: 'space-between'},
row: {flexDirection: 'row'},
textActionLabel: {
color: '#787878',
fontSize: 18,
},
textEditorContainer: {
marginLeft: 10,
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment