diff options
author | hoodie <hoodiekitten@outlook.com> | 2017-02-04 17:33:46 -0500 |
---|---|---|
committer | hoodie <hoodiekitten@outlook.com> | 2017-02-04 17:33:46 -0500 |
commit | d4d3a10c25ea3b74e1c9ff7312715c33718da3b0 (patch) | |
tree | 6b24aef6a684f233a26ae6ceec54fc244ff42064 /app/assets/javascripts | |
parent | ccb8ac857330e1ad3aee37b340e5c6e242ac1dd6 (diff) |
untested!! spoiler hotfix for replies
untested, my vagrant is bugged again, submitted at gargron's request
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r-- | app/assets/javascripts/components/components/status_content.jsx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/app/assets/javascripts/components/components/status_content.jsx b/app/assets/javascripts/components/components/status_content.jsx index 44346fabc..dd11d3a01 100644 --- a/app/assets/javascripts/components/components/status_content.jsx +++ b/app/assets/javascripts/components/components/status_content.jsx @@ -3,6 +3,7 @@ import PureRenderMixin from 'react-addons-pure-render-mixin'; import escapeTextContentForBrowser from 'react/lib/escapeTextContentForBrowser'; import emojify from '../emoji'; import { FormattedMessage } from 'react-intl'; +import Permalink from './permalink'; const spoilerStyle = { display: 'inline-block', @@ -96,16 +97,18 @@ const StatusContent = React.createClass({ const { status } = this.props; const { hidden } = this.state; + const content = { __html: emojify(status.get('content')) }; const spoilerContent = { __html: emojify(escapeTextContentForBrowser(status.get('spoiler_text', ''))) }; if (status.get('spoiler_text').length > 0) { + const mentionLinks = status.get('mentions').map(item => <Permalink to={`/accounts/${item.get('id')}`} href={item.get('url')} key={item.get('id') className='mention'>@<span>{item.get('username')}</span></Permalink>}</span>) }; const toggleText = hidden ? <FormattedMessage id='status.show_more' defaultMessage='Show more' /> : <FormattedMessage id='status.show_less' defaultMessage='Show less' />; - return ( <div className='status__content' style={{ cursor: 'pointer' }} onMouseDown={this.handleMouseDown} onMouseUp={this.handleMouseUp}> <p style={{ marginBottom: hidden ? '0px' : '' }} > - <span dangerouslySetInnerHTML={spoilerContent} /> <a className='status__content__spoiler-link' style={spoilerStyle} onClick={this.handleSpoilerClick}>{toggleText}</a> + {mentionLinks} + <span dangerouslySetInnerHTML={spoilerContent} /> <a className='status__content__spoiler-link' style={spoilerStyle} onClick={this.handleSpoilerClick}>{toggleText}</a> </p> <div style={{ display: hidden ? 'none' : 'block' }} dangerouslySetInnerHTML={content} /> |