From 86574ea5248219fa35ecb0748920df9ff1ce6110 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Tue, 8 Nov 2016 21:45:51 +0100 Subject: Adding Emoji One --- .../components/components/status_content.jsx | 9 +++++++-- app/assets/stylesheets/components.scss | 21 +++++++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) (limited to 'app') 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
; }, 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; + } } } -- cgit