diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2016-11-08 21:45:51 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2016-11-08 21:46:29 +0100 |
commit | 86574ea5248219fa35ecb0748920df9ff1ce6110 (patch) | |
tree | c9d0499dff42bb4fd6afb5a6691245f6030354da /app | |
parent | b6832553ff023164cce2dd01889155aa9be216bf (diff) |
Adding Emoji One
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/components/components/status_content.jsx | 9 | ||||
-rw-r--r-- | app/assets/stylesheets/components.scss | 21 |
2 files changed, 28 insertions, 2 deletions
diff --git a/app/assets/javascripts/components/components/status_content.jsx b/app/assets/javascripts/components/components/status_content.jsx index 67fd9cb69..a6321d31c 100644 --- a/app/assets/javascripts/components/components/status_content.jsx +++ b/app/assets/javascripts/components/components/status_content.jsx @@ -1,5 +1,10 @@ import ImmutablePropTypes from 'react-immutable-proptypes'; -import PureRenderMixin from 'react-addons-pure-render-mixin'; +import PureRenderMixin from 'react-addons-pure-render-mixin'; +import emojione from 'emojione'; + +emojione.imageType = 'png'; +emojione.sprites = false; +emojione.imagePathPNG = '/emoji/'; const StatusContent = React.createClass({ @@ -55,7 +60,7 @@ const StatusContent = React.createClass({ }, render () { - const content = { __html: this.props.status.get('content') }; + const content = { __html: emojione.unicodeToImage(this.props.status.get('content')) }; return <div className='status__content' dangerouslySetInnerHTML={content} />; }, diff --git a/app/assets/stylesheets/components.scss b/app/assets/stylesheets/components.scss index 16327168c..71ef7f3a8 100644 --- a/app/assets/stylesheets/components.scss +++ b/app/assets/stylesheets/components.scss @@ -71,6 +71,17 @@ } } +.emojione { + display: inline-block; + font-size: inherit; + vertical-align: middle; + margin: -.2ex .15em .2ex; + + img { + width: auto; + } +} + .status__content, .reply-indicator__content { font-size: 15px; line-height: 20px; @@ -78,6 +89,11 @@ font-weight: 300; overflow: hidden; + .emojione { + width: 18px; + height: 18px; + } + p { margin-bottom: 20px; @@ -110,6 +126,11 @@ .status__content { font-size: 19px; line-height: 24px; + + .emojione { + width: 22px; + height: 22px; + } } } |