]> cat aescling's git repositories - mastodon.git/commitdiff
Graphic emoji in usernames in the "reblogged" string above status
authorEugen Rochko <eugen@zeonfederated.com>
Fri, 18 Nov 2016 23:28:42 +0000 (00:28 +0100)
committerEugen Rochko <eugen@zeonfederated.com>
Fri, 18 Nov 2016 23:28:42 +0000 (00:28 +0100)
app/assets/javascripts/components/components/status.jsx
app/assets/stylesheets/components.scss

index 8077308c44c9469e0fbacdd08c6a3ad27195155a..2d463b9d1e9cfc3f0ed3f7383c7abee59c056c8e 100644 (file)
@@ -8,6 +8,8 @@ import VideoPlayer from './video_player';
 import StatusContent from './status_content';
 import StatusActionBar from './status_action_bar';
 import { FormattedMessage } from 'react-intl';
+import emojify from '../emoji';
+import escapeTextContentForBrowser from 'react/lib/escapeTextContentForBrowser';
 
 const Status = React.createClass({
 
@@ -56,11 +58,13 @@ const Status = React.createClass({
         displayName = status.getIn(['account', 'username']);
       }
 
+      const displayNameHTML = { __html: emojify(escapeTextContentForBrowser(displayName)) };
+
       return (
         <div style={{ cursor: 'default' }}>
           <div style={{ marginLeft: '68px', color: '#616b86', padding: '8px 0', paddingBottom: '2px', fontSize: '14px', position: 'relative' }}>
             <div style={{ position: 'absolute', 'left': '-26px'}}><i className='fa fa-fw fa-retweet'></i></div>
-            <FormattedMessage id='status.reblogged_by' defaultMessage='{name} reblogged' values={{ name: <a onClick={this.handleAccountClick.bind(this, status.getIn(['account', 'id']))} href={status.getIn(['account', 'url'])} className='status__display-name'><strong style={{ color: '#616b86'}}>{displayName}</strong></a> }} />
+            <FormattedMessage id='status.reblogged_by' defaultMessage='{name} reblogged' values={{ name: <a onClick={this.handleAccountClick.bind(this, status.getIn(['account', 'id']))} href={status.getIn(['account', 'url'])} className='status__display-name muted'><strong style={{ color: '#616b86'}} dangerouslySetInnerHTML={displayNameHTML} /></a> }} />
           </div>
 
           <Status {...other} wrapped={true} status={status.get('reblog')} />
index c15a827a4046b8232083ed7f284ffcbaa0c58913..ba091c15e08cf2f24e93ad4420873e58b7049f26 100644 (file)
   strong {
     color: #fff;
   }
+
+  &.muted {
+    .emojione {
+      opacity: 0.5;
+    }
+  }
 }
 
 .status__display-name, .reply-indicator__display-name, .detailed-status__display-name, .account__display-name {