'use strict';

import React from 'react';
import { Text } from 'react-native';
import PropTypes from 'prop-types';
import nodeEmoji from 'node-emoji';

const names = Object.keys(nodeEmoji.emoji);

const defaultStyle = {
  color: '#000'
};

const Emoji = ({name, style = {}, ...props}) => {
  style = {
    ...defaultStyle,
    ...style
  };

  return <Text style={style} {...props}>{ nodeEmoji.get(name) }</Text>
};

Emoji.propTypes = {
  ...Text.propTypes,
  name: PropTypes.oneOf(names).isRequired
};

export default Emoji;

@@ -151,20 +151,19 @@
 %0A%0Aconst 
-name
+key
 s = Obje
@@ -187,16 +187,114 @@
 .emoji);
+%0Aconst names = %5B...keys, ...keys.map((key) =%3E %60:$%7Bkey%7D:%60)%5D; // Support git flavored markdown emoji
 %0A%0Aconst 

Support git flavored markdown emoji