From 489bd99803cde976d78c312b0079d8de50f3617c Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Tue, 15 Nov 2016 18:38:57 +0100 Subject: Support emojis in display name, bio --- .../components/features/account/components/header.jsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'app/assets/javascripts/components/features/account') diff --git a/app/assets/javascripts/components/features/account/components/header.jsx b/app/assets/javascripts/components/features/account/components/header.jsx index 062f4a0f2..7a086c99a 100644 --- a/app/assets/javascripts/components/features/account/components/header.jsx +++ b/app/assets/javascripts/components/features/account/components/header.jsx @@ -1,5 +1,7 @@ -import PureRenderMixin from 'react-addons-pure-render-mixin'; +import PureRenderMixin from 'react-addons-pure-render-mixin'; import ImmutablePropTypes from 'react-immutable-proptypes'; +import emojify from '../../../emoji'; +import escapeTextContentForBrowser from 'react/lib/escapeTextContentForBrowser'; const Header = React.createClass({ @@ -14,7 +16,7 @@ const Header = React.createClass({ const { account, me } = this.props; let displayName = account.get('display_name'); - let info = ''; + let info = ''; if (displayName.length === 0) { displayName = account.get('username'); @@ -24,7 +26,8 @@ const Header = React.createClass({ info = Follows you } - const content = { __html: account.get('note') }; + const content = { __html: emojify(account.get('note')) }; + const displayNameHTML = { __html: emojify(escapeTextContentForBrowser(displayName)) }; return (
@@ -34,7 +37,7 @@ const Header = React.createClass({
- {displayName} + @{account.get('acct')} -- cgit