@100mslive/react-native-room-kit
Version:
100ms Room Kit provides simple & easy to use UI components to build Live Streaming & Video Conferencing experiences in your apps.
50 lines • 1.43 kB
JavaScript
import * as React from 'react';
import { Platform, StyleSheet } from 'react-native';
import { HMSTextInput } from './HMSTextInput';
import { useHMSRoomStyleSheet, useSendMessage } from '../hooks-util';
import { TestIds } from '../utils/constants';
export const HMSSendMessageInput = ({
style,
containerStyle
}) => {
const {
message,
sendMessage,
setMessage
} = useSendMessage();
const hmsRoomStyles = useHMSRoomStyleSheet(theme => ({
containerStyle: {
backgroundColor: theme.palette.surface_dim,
borderColor: theme.palette.surface_dim
}
}));
return /*#__PURE__*/React.createElement(HMSTextInput, {
testID: TestIds.enter_message_input,
style: [styles.input, style],
value: message,
onChangeText: setMessage,
placeholder: "Send a message...",
autoCapitalize: "sentences",
autoComplete: "off",
containerStyle: [styles.inputContainer, hmsRoomStyles.containerStyle, containerStyle],
sendIcon: true,
sendIconTestID: TestIds.send_message_cta,
onSendIconPress: sendMessage,
onSubmitEditing: sendMessage,
returnKeyType: "send"
});
};
const styles = StyleSheet.create({
input: {
fontSize: 14,
lineHeight: Platform.OS === 'android' ? 20 : undefined,
letterSpacing: 0.25
},
inputContainer: {
height: 40,
marginHorizontal: 8,
marginTop: 4,
marginBottom: 8
}
});
//# sourceMappingURL=HMSSendMessageInput.js.map