Skip to content

Instantly share code, notes, and snippets.

@samajammin
Created October 14, 2020 01:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samajammin/e954707c50d896d5d5f0de6f860b53e3 to your computer and use it in GitHub Desktop.
Save samajammin/e954707c50d896d5d5f0de6f860b53e3 to your computer and use it in GitHub Desktop.
import React from "react"
import { Twemoji } from "react-emoji-render"
import styled from "styled-components"
const Emoji = ({
size = 1.5,
text,
marginLeft = 0,
marginRight = 0,
marginBottom = 0,
marginTop = 0,
}) => {
return (
<StyledEmoji
size={size}
text={text}
marginLeft={marginLeft}
marginRight={marginRight}
marginBottom={marginBottom}
marginTop={marginTop}
/>
)
}
const StyledEmoji = styled(Twemoji)`
& > img {
width: ${(props) => props.size}em !important;
height: ${(props) => props.size}em !important;
margin-left: ${(props) => props.marginLeft}em !important;
margin-right: ${(props) => props.marginRight}em !important;
margin-bottom: ${(props) => props.marginBottom}em !important;
margin-top: ${(props) => props.marginTop}em !important;
}
`
export default Emoji
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment