verdnatura-chat/app/containers/markdown/MessageBody/Emoji.js

33 lines
743 B
JavaScript
Raw Normal View History

2021-08-12 21:05:18 +00:00
import React from 'react';
import { Text } from 'react-native';
import PropTypes from 'prop-types';
import shortnameToUnicode from '../../../utils/shortnameToUnicode';
import { themes } from '../../../constants/colors';
import { useTheme } from '../../../theme';
import styles from '../styles';
const Emoji = ({ emojiHandle, style, isBigEmoji }) => {
const { theme } = useTheme();
const emojiUnicode = shortnameToUnicode(emojiHandle);
return (
<Text
style={[
{ color: themes[theme].bodyText },
isBigEmoji ? styles.textBig : styles.text,
style
]}
>
{emojiUnicode}
</Text>
);
};
Emoji.propTypes = {
emojiHandle: PropTypes.string,
style: PropTypes.object,
isBigEmoji: PropTypes.bool
};
export default Emoji;