@livelike/react-native
Version:
LiveLike React Native package
55 lines • 1.41 kB
JavaScript
import React from 'react';
import { Pressable, StyleSheet, ActivityIndicator, Image } from 'react-native';
import { useStyles, useTheme } from '../../hooks';
export function LLComposerSendButton(_ref) {
let {
onPress,
disabled,
styles: stylesProp,
isSendingMessage
} = _ref;
const {
themeAssets
} = useTheme();
const composerButtonStyles = useStyles({
componentStylesFn: getComposerButtonStyles({
disabled
}),
stylesProp
});
return /*#__PURE__*/React.createElement(Pressable, {
onPress: onPress,
accessibilityLabel: "Send Message",
disabled: disabled,
style: composerButtonStyles.buttonContainer
}, isSendingMessage ? /*#__PURE__*/React.createElement(ActivityIndicator, {
size: "small",
color: "white"
}) : /*#__PURE__*/React.createElement(Image, {
style: composerButtonStyles.icon,
source: themeAssets.send
}));
}
const getComposerButtonStyles = props => _ref2 => {
let {
theme
} = _ref2;
return StyleSheet.create({
buttonContainer: {
height: 45,
width: 45,
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
borderRadius: 10,
marginLeft: 5,
backgroundColor: theme.primaryButtonBackground,
opacity: props.disabled ? 0.5 : 1
},
icon: {
height: 18,
width: 18
}
});
};
//# sourceMappingURL=LLComposerSendButton.js.map