|
|
@ -1,7 +1,6 @@
|
|
|
|
import React from 'react';
|
|
|
|
import React from 'react';
|
|
|
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
|
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import { isRtl } from '../rtl';
|
|
|
|
|
|
|
|
import { FormattedMessage } from 'react-intl';
|
|
|
|
import { FormattedMessage } from 'react-intl';
|
|
|
|
import Permalink from './permalink';
|
|
|
|
import Permalink from './permalink';
|
|
|
|
import classnames from 'classnames';
|
|
|
|
import classnames from 'classnames';
|
|
|
@ -186,17 +185,12 @@ export default class StatusContent extends React.PureComponent {
|
|
|
|
|
|
|
|
|
|
|
|
const content = { __html: status.get('contentHtml') };
|
|
|
|
const content = { __html: status.get('contentHtml') };
|
|
|
|
const spoilerContent = { __html: status.get('spoilerHtml') };
|
|
|
|
const spoilerContent = { __html: status.get('spoilerHtml') };
|
|
|
|
const directionStyle = { direction: 'ltr' };
|
|
|
|
|
|
|
|
const classNames = classnames('status__content', {
|
|
|
|
const classNames = classnames('status__content', {
|
|
|
|
'status__content--with-action': this.props.onClick && this.context.router,
|
|
|
|
'status__content--with-action': this.props.onClick && this.context.router,
|
|
|
|
'status__content--with-spoiler': status.get('spoiler_text').length > 0,
|
|
|
|
'status__content--with-spoiler': status.get('spoiler_text').length > 0,
|
|
|
|
'status__content--collapsed': renderReadMore,
|
|
|
|
'status__content--collapsed': renderReadMore,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
if (isRtl(status.get('search_index'))) {
|
|
|
|
|
|
|
|
directionStyle.direction = 'rtl';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const showThreadButton = (
|
|
|
|
const showThreadButton = (
|
|
|
|
<button className='status__content__read-more-button' onClick={this.props.onClick}>
|
|
|
|
<button className='status__content__read-more-button' onClick={this.props.onClick}>
|
|
|
|
<FormattedMessage id='status.show_thread' defaultMessage='Show thread' />
|
|
|
|
<FormattedMessage id='status.show_thread' defaultMessage='Show thread' />
|
|
|
@ -225,7 +219,7 @@ export default class StatusContent extends React.PureComponent {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div className={classNames} ref={this.setRef} tabIndex='0' style={directionStyle} onMouseDown={this.handleMouseDown} onMouseUp={this.handleMouseUp}>
|
|
|
|
<div className={classNames} ref={this.setRef} tabIndex='0' onMouseDown={this.handleMouseDown} onMouseUp={this.handleMouseUp}>
|
|
|
|
<p style={{ marginBottom: hidden && status.get('mentions').isEmpty() ? '0px' : null }}>
|
|
|
|
<p style={{ marginBottom: hidden && status.get('mentions').isEmpty() ? '0px' : null }}>
|
|
|
|
<span dangerouslySetInnerHTML={spoilerContent} />
|
|
|
|
<span dangerouslySetInnerHTML={spoilerContent} />
|
|
|
|
{' '}
|
|
|
|
{' '}
|
|
|
@ -234,7 +228,7 @@ export default class StatusContent extends React.PureComponent {
|
|
|
|
|
|
|
|
|
|
|
|
{mentionsPlaceholder}
|
|
|
|
{mentionsPlaceholder}
|
|
|
|
|
|
|
|
|
|
|
|
<div tabIndex={!hidden ? 0 : null} className={`status__content__text ${!hidden ? 'status__content__text--visible' : ''}`} style={directionStyle} dangerouslySetInnerHTML={content} />
|
|
|
|
<div tabIndex={!hidden ? 0 : null} className={`status__content__text ${!hidden ? 'status__content__text--visible' : ''}`} dangerouslySetInnerHTML={content} />
|
|
|
|
|
|
|
|
|
|
|
|
{!hidden && !!status.get('poll') && <PollContainer pollId={status.get('poll')} />}
|
|
|
|
{!hidden && !!status.get('poll') && <PollContainer pollId={status.get('poll')} />}
|
|
|
|
|
|
|
|
|
|
|
@ -243,8 +237,8 @@ export default class StatusContent extends React.PureComponent {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
} else if (this.props.onClick) {
|
|
|
|
} else if (this.props.onClick) {
|
|
|
|
const output = [
|
|
|
|
const output = [
|
|
|
|
<div className={classNames} ref={this.setRef} tabIndex='0' style={directionStyle} onMouseDown={this.handleMouseDown} onMouseUp={this.handleMouseUp} key='status-content'>
|
|
|
|
<div className={classNames} ref={this.setRef} tabIndex='0' onMouseDown={this.handleMouseDown} onMouseUp={this.handleMouseUp} key='status-content'>
|
|
|
|
<div className='status__content__text status__content__text--visible' style={directionStyle} dangerouslySetInnerHTML={content} />
|
|
|
|
<div className='status__content__text status__content__text--visible' dangerouslySetInnerHTML={content} />
|
|
|
|
|
|
|
|
|
|
|
|
{!!status.get('poll') && <PollContainer pollId={status.get('poll')} />}
|
|
|
|
{!!status.get('poll') && <PollContainer pollId={status.get('poll')} />}
|
|
|
|
|
|
|
|
|
|
|
@ -259,8 +253,8 @@ export default class StatusContent extends React.PureComponent {
|
|
|
|
return output;
|
|
|
|
return output;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div className={classNames} ref={this.setRef} tabIndex='0' style={directionStyle}>
|
|
|
|
<div className={classNames} ref={this.setRef} tabIndex='0'>
|
|
|
|
<div className='status__content__text status__content__text--visible' style={directionStyle} dangerouslySetInnerHTML={content} />
|
|
|
|
<div className='status__content__text status__content__text--visible' dangerouslySetInnerHTML={content} />
|
|
|
|
|
|
|
|
|
|
|
|
{!!status.get('poll') && <PollContainer pollId={status.get('poll')} />}
|
|
|
|
{!!status.get('poll') && <PollContainer pollId={status.get('poll')} />}
|
|
|
|
|
|
|
|
|
|
|
|