The code powering m.abunchtell.com https://m.abunchtell.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

38 lines
768 B

  1. import React from 'react';
  2. import PropTypes from 'prop-types';
  3. import { unicodeMapping } from '../emojione_light';
  4. const assetHost = process.env.CDN_HOST || '';
  5. export default class AutosuggestEmoji extends React.PureComponent {
  6. static propTypes = {
  7. emoji: PropTypes.object.isRequired,
  8. };
  9. render () {
  10. const { emoji } = this.props;
  11. let url;
  12. if (emoji.custom) {
  13. url = emoji.imageUrl;
  14. } else {
  15. const [ filename ] = unicodeMapping[emoji.native];
  16. url = `${assetHost}/emoji/${filename}.svg`;
  17. }
  18. return (
  19. <div className='autosuggest-emoji'>
  20. <img
  21. className='emojione'
  22. src={url}
  23. alt={emoji.native || emoji.colons}
  24. />
  25. {emoji.colons}
  26. </div>
  27. );
  28. }
  29. }