2017-04-22 03:05:35 +09:00
|
|
|
import PropTypes from 'prop-types';
|
2023-05-28 16:38:10 +02:00
|
|
|
import { PureComponent } from 'react';
|
|
|
|
|
2022-09-23 23:00:12 +02:00
|
|
|
import { FormattedMessage, injectIntl } from 'react-intl';
|
2023-05-28 16:38:10 +02:00
|
|
|
|
2017-07-15 15:10:06 -07:00
|
|
|
import classnames from 'classnames';
|
2023-10-19 19:44:55 +02:00
|
|
|
import { withRouter } from 'react-router-dom';
|
2023-05-28 16:38:10 +02:00
|
|
|
|
|
|
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
|
|
import { connect } from 'react-redux';
|
|
|
|
|
2024-12-22 20:27:32 +01:00
|
|
|
import ChevronRightIcon from '@/material-icons/400-24px/chevron_right.svg?react';
|
2023-05-09 03:11:56 +02:00
|
|
|
import { Icon } from 'flavours/glitch/components/icon';
|
2024-12-29 19:59:19 +01:00
|
|
|
import PollContainer from 'flavours/glitch/containers/poll_container';
|
2024-05-19 19:07:32 +02:00
|
|
|
import { identityContextPropShape, withIdentity } from 'flavours/glitch/identity_context';
|
2023-03-03 21:06:31 +01:00
|
|
|
import { autoPlayGif, languages as preloadedLanguages } from 'flavours/glitch/initial_state';
|
2022-10-11 10:41:15 +02:00
|
|
|
import { decode as decodeIDNA } from 'flavours/glitch/utils/idna';
|
2024-01-12 21:16:48 +01:00
|
|
|
|
2024-12-22 20:27:32 +01:00
|
|
|
const MAX_HEIGHT = 706; // 22px * 32 (+ 2px padding at the top)
|
|
|
|
|
2019-08-01 17:48:11 +02:00
|
|
|
const textMatchesTarget = (text, origin, host) => {
|
|
|
|
return (text === origin || text === host
|
|
|
|
|| text.startsWith(origin + '/') || text.startsWith(host + '/')
|
|
|
|
|| 'www.' + text === host || ('www.' + text).startsWith(host + '/'));
|
2023-02-03 20:52:07 +01:00
|
|
|
};
|
2019-08-01 17:48:11 +02:00
|
|
|
|
2019-08-01 18:48:16 +02:00
|
|
|
const isLinkMisleading = (link) => {
|
2019-08-01 15:01:09 +02:00
|
|
|
let linkTextParts = [];
|
|
|
|
|
|
|
|
// Reconstruct visible text, as we do not have much control over how links
|
|
|
|
// from remote software look, and we can't rely on `innerText` because the
|
|
|
|
// `invisible` class does not set `display` to `none`.
|
|
|
|
|
|
|
|
const walk = (node) => {
|
|
|
|
switch (node.nodeType) {
|
|
|
|
case Node.TEXT_NODE:
|
|
|
|
linkTextParts.push(node.textContent);
|
|
|
|
break;
|
2024-10-01 12:26:30 -04:00
|
|
|
case Node.ELEMENT_NODE: {
|
2019-08-01 15:01:09 +02:00
|
|
|
if (node.classList.contains('invisible')) return;
|
|
|
|
const children = node.childNodes;
|
|
|
|
for (let i = 0; i < children.length; i++) {
|
|
|
|
walk(children[i]);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2024-10-01 12:26:30 -04:00
|
|
|
}
|
2019-08-01 15:01:09 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
walk(link);
|
|
|
|
|
|
|
|
const linkText = linkTextParts.join('');
|
|
|
|
const targetURL = new URL(link.href);
|
|
|
|
|
2020-01-26 15:26:03 +01:00
|
|
|
if (targetURL.protocol === 'magnet:') {
|
|
|
|
return !linkText.startsWith('magnet:');
|
|
|
|
}
|
|
|
|
|
|
|
|
if (targetURL.protocol === 'xmpp:') {
|
|
|
|
return !(linkText === targetURL.href || 'xmpp:' + linkText === targetURL.href);
|
|
|
|
}
|
|
|
|
|
2019-08-01 15:01:09 +02:00
|
|
|
// The following may not work with international domain names
|
2019-08-01 17:48:11 +02:00
|
|
|
if (textMatchesTarget(linkText, targetURL.origin, targetURL.host) || textMatchesTarget(linkText.toLowerCase(), targetURL.origin, targetURL.host)) {
|
2019-08-01 15:01:09 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
// The link hasn't been recognized, maybe it features an international domain name
|
2019-08-01 18:13:08 +02:00
|
|
|
const hostname = decodeIDNA(targetURL.hostname).normalize('NFKC');
|
2019-08-01 15:01:09 +02:00
|
|
|
const host = targetURL.host.replace(targetURL.hostname, hostname);
|
|
|
|
const origin = targetURL.origin.replace(targetURL.host, host);
|
2019-08-01 18:13:08 +02:00
|
|
|
const text = linkText.normalize('NFKC');
|
2019-08-01 18:48:16 +02:00
|
|
|
return !(textMatchesTarget(text, origin, host) || textMatchesTarget(text.toLowerCase(), origin, host));
|
2019-08-01 15:01:09 +02:00
|
|
|
};
|
2017-07-12 01:02:51 -07:00
|
|
|
|
2023-08-21 19:39:01 +02:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @param {any} status
|
|
|
|
* @returns {string}
|
|
|
|
*/
|
|
|
|
export function getStatusContent(status) {
|
|
|
|
return status.getIn(['translation', 'contentHtml']) || status.get('contentHtml');
|
|
|
|
}
|
|
|
|
|
2023-05-28 14:18:23 +02:00
|
|
|
class TranslateButton extends PureComponent {
|
2022-10-25 18:47:21 +02:00
|
|
|
|
|
|
|
static propTypes = {
|
|
|
|
translation: ImmutablePropTypes.map,
|
|
|
|
onClick: PropTypes.func,
|
|
|
|
};
|
|
|
|
|
|
|
|
render () {
|
|
|
|
const { translation, onClick } = this.props;
|
|
|
|
|
|
|
|
if (translation) {
|
|
|
|
const language = preloadedLanguages.find(lang => lang[0] === translation.get('detected_source_language'));
|
2025-01-03 16:29:25 +01:00
|
|
|
const languageName = language ? language[1] : translation.get('detected_source_language');
|
2022-10-25 18:47:21 +02:00
|
|
|
const provider = translation.get('provider');
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div className='translate-button'>
|
|
|
|
<div className='translate-button__meta'>
|
|
|
|
<FormattedMessage id='status.translated_from_with' defaultMessage='Translated from {lang} using {provider}' values={{ lang: languageName, provider }} />
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<button className='link-button' onClick={onClick}>
|
|
|
|
<FormattedMessage id='status.show_original' defaultMessage='Show original' />
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
2023-07-08 00:12:31 +02:00
|
|
|
<button className='status__content__translate-button' onClick={onClick}>
|
2022-10-25 18:47:21 +02:00
|
|
|
<FormattedMessage id='status.translate' defaultMessage='Translate' />
|
|
|
|
</button>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2023-03-16 11:07:24 +01:00
|
|
|
const mapStateToProps = state => ({
|
|
|
|
languages: state.getIn(['server', 'translationLanguages', 'items']),
|
|
|
|
});
|
|
|
|
|
2023-05-28 14:18:23 +02:00
|
|
|
class StatusContent extends PureComponent {
|
2017-05-12 21:44:10 +09:00
|
|
|
static propTypes = {
|
2024-05-19 19:07:32 +02:00
|
|
|
identity: identityContextPropShape,
|
2017-05-12 21:44:10 +09:00
|
|
|
status: ImmutablePropTypes.map.isRequired,
|
2023-08-21 19:39:01 +02:00
|
|
|
statusContent: PropTypes.string,
|
2022-09-23 23:00:12 +02:00
|
|
|
onTranslate: PropTypes.func,
|
2024-12-22 20:27:32 +01:00
|
|
|
onClick: PropTypes.func,
|
|
|
|
collapsible: PropTypes.bool,
|
|
|
|
onCollapsedToggle: PropTypes.func,
|
2019-08-01 18:48:16 +02:00
|
|
|
tagLinks: PropTypes.bool,
|
2019-08-28 22:13:41 +02:00
|
|
|
rewriteMentions: PropTypes.string,
|
2023-03-16 11:07:24 +01:00
|
|
|
languages: ImmutablePropTypes.map,
|
2022-09-23 23:00:12 +02:00
|
|
|
intl: PropTypes.object,
|
2023-10-19 19:44:55 +02:00
|
|
|
// from react-router
|
|
|
|
match: PropTypes.object.isRequired,
|
|
|
|
location: PropTypes.object.isRequired,
|
|
|
|
history: PropTypes.object.isRequired
|
2019-08-01 15:01:09 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
static defaultProps = {
|
2019-08-01 18:48:16 +02:00
|
|
|
tagLinks: true,
|
2019-08-28 22:13:41 +02:00
|
|
|
rewriteMentions: 'no',
|
2017-05-12 21:44:10 +09:00
|
|
|
};
|
|
|
|
|
2017-11-17 19:11:18 -08:00
|
|
|
_updateStatusLinks () {
|
2024-12-29 19:59:19 +01:00
|
|
|
const node = this.node;
|
2019-08-28 22:13:41 +02:00
|
|
|
const { tagLinks, rewriteMentions } = this.props;
|
2018-03-12 18:39:07 +01:00
|
|
|
|
|
|
|
if (!node) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2024-12-22 20:27:32 +01:00
|
|
|
const { status, onCollapsedToggle } = this.props;
|
2016-09-23 20:23:26 +02:00
|
|
|
const links = node.querySelectorAll('a');
|
|
|
|
|
2024-12-22 20:27:32 +01:00
|
|
|
let link, mention;
|
|
|
|
|
2017-11-17 19:11:18 -08:00
|
|
|
for (var i = 0; i < links.length; ++i) {
|
2024-12-22 20:27:32 +01:00
|
|
|
link = links[i];
|
|
|
|
|
2017-11-17 19:11:18 -08:00
|
|
|
if (link.classList.contains('status-link')) {
|
|
|
|
continue;
|
|
|
|
}
|
2024-12-22 20:27:32 +01:00
|
|
|
|
2017-11-17 19:11:18 -08:00
|
|
|
link.classList.add('status-link');
|
|
|
|
|
2024-12-22 20:27:32 +01:00
|
|
|
mention = this.props.status.get('mentions').find(item => link.href === item.get('url'));
|
2016-09-23 20:23:26 +02:00
|
|
|
|
|
|
|
if (mention) {
|
2016-10-14 01:03:12 +02:00
|
|
|
link.addEventListener('click', this.onMentionClick.bind(this, mention), false);
|
2024-07-11 21:42:58 +02:00
|
|
|
link.setAttribute('title', `@${mention.get('acct')}`);
|
2024-06-26 21:33:38 +02:00
|
|
|
link.setAttribute('data-hover-card-account', mention.get('id'));
|
2019-08-28 22:13:41 +02:00
|
|
|
if (rewriteMentions !== 'no') {
|
|
|
|
while (link.firstChild) link.removeChild(link.firstChild);
|
|
|
|
link.appendChild(document.createTextNode('@'));
|
|
|
|
const acctSpan = document.createElement('span');
|
|
|
|
acctSpan.textContent = rewriteMentions === 'acct' ? mention.get('acct') : mention.get('username');
|
|
|
|
link.appendChild(acctSpan);
|
|
|
|
}
|
2016-11-05 17:54:19 +01:00
|
|
|
} else if (link.textContent[0] === '#' || (link.previousSibling && link.previousSibling.textContent && link.previousSibling.textContent[link.previousSibling.textContent.length - 1] === '#')) {
|
2016-11-05 15:20:05 +01:00
|
|
|
link.addEventListener('click', this.onHashtagClick.bind(this, link.text), false);
|
2016-09-23 20:23:26 +02:00
|
|
|
} else {
|
2017-04-14 13:22:56 +02:00
|
|
|
link.setAttribute('title', link.href);
|
2019-07-28 06:00:51 +02:00
|
|
|
link.classList.add('unhandled-link');
|
2019-08-01 15:01:09 +02:00
|
|
|
|
2023-02-03 20:52:07 +01:00
|
|
|
link.setAttribute('target', '_blank');
|
|
|
|
link.setAttribute('rel', 'noopener nofollow noreferrer');
|
2022-10-25 18:47:04 +02:00
|
|
|
|
2019-08-06 11:31:28 +02:00
|
|
|
try {
|
|
|
|
if (tagLinks && isLinkMisleading(link)) {
|
|
|
|
// Add a tag besides the link to display its origin
|
|
|
|
|
2020-01-26 15:26:03 +01:00
|
|
|
const url = new URL(link.href);
|
2019-08-06 11:31:28 +02:00
|
|
|
const tag = document.createElement('span');
|
|
|
|
tag.classList.add('link-origin-tag');
|
2020-01-26 15:26:03 +01:00
|
|
|
switch (url.protocol) {
|
|
|
|
case 'xmpp:':
|
|
|
|
tag.textContent = `[${url.href}]`;
|
|
|
|
break;
|
|
|
|
case 'magnet:':
|
|
|
|
tag.textContent = '(magnet)';
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
tag.textContent = `[${url.host}]`;
|
|
|
|
}
|
2019-08-06 11:31:28 +02:00
|
|
|
link.insertAdjacentText('beforeend', ' ');
|
|
|
|
link.insertAdjacentElement('beforeend', tag);
|
|
|
|
}
|
2019-08-06 12:56:19 +02:00
|
|
|
} catch (e) {
|
|
|
|
// The URL is invalid, remove the href just to be safe
|
|
|
|
if (tagLinks && e instanceof TypeError) link.removeAttribute('href');
|
2019-08-01 15:01:09 +02:00
|
|
|
}
|
2016-09-23 20:23:26 +02:00
|
|
|
}
|
|
|
|
}
|
2024-12-22 20:27:32 +01:00
|
|
|
|
|
|
|
if (status.get('collapsed', null) === null && onCollapsedToggle) {
|
|
|
|
const { collapsible, onClick } = this.props;
|
|
|
|
|
|
|
|
const collapsed =
|
|
|
|
collapsible
|
|
|
|
&& onClick
|
|
|
|
&& node.clientHeight > MAX_HEIGHT
|
|
|
|
&& status.get('spoiler_text').length === 0;
|
|
|
|
|
|
|
|
onCollapsedToggle(collapsed);
|
|
|
|
}
|
2017-04-22 03:05:35 +09:00
|
|
|
}
|
2016-09-22 00:32:27 +02:00
|
|
|
|
2021-01-31 21:25:31 +01:00
|
|
|
handleMouseEnter = ({ currentTarget }) => {
|
|
|
|
if (autoPlayGif) {
|
2019-07-21 18:10:40 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-01-31 21:25:31 +01:00
|
|
|
const emojis = currentTarget.querySelectorAll('.custom-emoji');
|
2019-07-21 18:10:40 +02:00
|
|
|
|
|
|
|
for (var i = 0; i < emojis.length; i++) {
|
|
|
|
let emoji = emojis[i];
|
2021-01-31 21:25:31 +01:00
|
|
|
emoji.src = emoji.getAttribute('data-original');
|
|
|
|
}
|
2023-02-03 20:52:07 +01:00
|
|
|
};
|
2021-01-31 21:25:31 +01:00
|
|
|
|
|
|
|
handleMouseLeave = ({ currentTarget }) => {
|
|
|
|
if (autoPlayGif) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
const emojis = currentTarget.querySelectorAll('.custom-emoji');
|
2019-07-21 18:10:40 +02:00
|
|
|
|
2021-01-31 21:25:31 +01:00
|
|
|
for (var i = 0; i < emojis.length; i++) {
|
|
|
|
let emoji = emojis[i];
|
|
|
|
emoji.src = emoji.getAttribute('data-static');
|
2019-07-21 18:10:40 +02:00
|
|
|
}
|
2023-02-03 20:52:07 +01:00
|
|
|
};
|
2019-07-21 18:10:40 +02:00
|
|
|
|
2017-11-17 19:11:18 -08:00
|
|
|
componentDidMount () {
|
|
|
|
this._updateStatusLinks();
|
|
|
|
}
|
|
|
|
|
2017-06-13 20:46:21 +02:00
|
|
|
componentDidUpdate () {
|
2017-11-17 19:11:18 -08:00
|
|
|
this._updateStatusLinks();
|
2017-06-13 20:46:21 +02:00
|
|
|
}
|
|
|
|
|
2017-05-12 21:44:10 +09:00
|
|
|
onMentionClick = (mention, e) => {
|
2024-12-22 20:27:32 +01:00
|
|
|
if (this.props.history && e.button === 0 && !(e.ctrlKey || e.metaKey)) {
|
|
|
|
e.preventDefault();
|
|
|
|
this.props.history.push(`/@${mention.get('acct')}`);
|
2016-09-22 00:32:27 +02:00
|
|
|
}
|
2023-02-03 20:52:07 +01:00
|
|
|
};
|
2016-10-03 18:17:06 +02:00
|
|
|
|
2017-05-12 21:44:10 +09:00
|
|
|
onHashtagClick = (hashtag, e) => {
|
2019-08-07 10:01:19 +02:00
|
|
|
hashtag = hashtag.replace(/^#/, '');
|
2016-11-05 15:20:05 +01:00
|
|
|
|
2024-12-22 20:27:32 +01:00
|
|
|
if (this.props.history && e.button === 0 && !(e.ctrlKey || e.metaKey)) {
|
|
|
|
e.preventDefault();
|
|
|
|
this.props.history.push(`/tags/${hashtag}`);
|
2016-11-05 15:20:05 +01:00
|
|
|
}
|
2023-02-03 20:52:07 +01:00
|
|
|
};
|
2016-09-22 00:32:27 +02:00
|
|
|
|
2017-05-12 21:44:10 +09:00
|
|
|
handleMouseDown = (e) => {
|
2017-01-24 17:05:44 +01:00
|
|
|
this.startXY = [e.clientX, e.clientY];
|
2023-02-03 20:52:07 +01:00
|
|
|
};
|
2017-01-24 17:05:44 +01:00
|
|
|
|
2017-05-12 21:44:10 +09:00
|
|
|
handleMouseUp = (e) => {
|
2024-12-22 20:27:32 +01:00
|
|
|
if (!this.startXY) {
|
2017-05-25 23:27:44 +09:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2017-01-24 17:05:44 +01:00
|
|
|
const [ startX, startY ] = this.startXY;
|
|
|
|
const [ deltaX, deltaY ] = [Math.abs(e.clientX - startX), Math.abs(e.clientY - startY)];
|
|
|
|
|
2019-03-05 23:17:09 +01:00
|
|
|
let element = e.target;
|
2021-07-12 14:44:35 +02:00
|
|
|
while (element !== e.currentTarget) {
|
|
|
|
if (['button', 'video', 'a', 'label', 'canvas'].includes(element.localName) || element.getAttribute('role') === 'button') {
|
2019-03-05 23:17:09 +01:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
element = element.parentNode;
|
2017-01-24 18:51:09 +01:00
|
|
|
}
|
|
|
|
|
2024-11-29 15:04:22 +01:00
|
|
|
if (deltaX + deltaY < 5 && (e.button === 0 || e.button === 1) && e.detail >= 1 && this.props.onClick) {
|
2024-12-22 20:27:32 +01:00
|
|
|
this.props.onClick(e);
|
2017-01-24 17:05:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
this.startXY = null;
|
2023-02-03 20:52:07 +01:00
|
|
|
};
|
2016-09-23 20:23:26 +02:00
|
|
|
|
2022-09-23 23:00:12 +02:00
|
|
|
handleTranslate = () => {
|
|
|
|
this.props.onTranslate();
|
2023-02-03 20:52:07 +01:00
|
|
|
};
|
2022-09-23 23:00:12 +02:00
|
|
|
|
2024-12-29 19:59:19 +01:00
|
|
|
setRef = (c) => {
|
|
|
|
this.node = c;
|
2023-02-03 20:52:07 +01:00
|
|
|
};
|
2019-07-24 21:14:37 +02:00
|
|
|
|
2016-09-22 00:32:27 +02:00
|
|
|
render () {
|
2024-12-29 19:59:19 +01:00
|
|
|
const { status, intl, statusContent } = this.props;
|
2017-06-13 20:46:21 +02:00
|
|
|
|
2024-12-22 20:27:32 +01:00
|
|
|
const renderReadMore = this.props.onClick && status.get('collapsed');
|
2023-03-16 11:07:24 +01:00
|
|
|
const contentLocale = intl.locale.replace(/[_-].*/, '');
|
|
|
|
const targetLanguages = this.props.languages?.get(status.get('language') || 'und');
|
2024-05-19 19:07:32 +02:00
|
|
|
const renderTranslate = this.props.onTranslate && this.props.identity.signedIn && ['public', 'unlisted'].includes(status.get('visibility')) && status.get('search_index').trim().length > 0 && targetLanguages?.includes(contentLocale);
|
2016-11-30 16:10:19 +01:00
|
|
|
|
2023-08-21 19:39:01 +02:00
|
|
|
const content = { __html: statusContent ?? getStatusContent(status) };
|
2023-06-01 00:10:21 +02:00
|
|
|
const language = status.getIn(['translation', 'language']) || status.get('language');
|
2017-07-15 15:10:06 -07:00
|
|
|
const classNames = classnames('status__content', {
|
2024-12-22 20:27:32 +01:00
|
|
|
'status__content--with-action': this.props.onClick && this.props.history,
|
|
|
|
'status__content--collapsed': renderReadMore,
|
2017-07-15 15:10:06 -07:00
|
|
|
});
|
2017-02-28 01:52:31 +01:00
|
|
|
|
2024-12-22 20:27:32 +01:00
|
|
|
const readMoreButton = renderReadMore && (
|
|
|
|
<button className='status__content__read-more-button' onClick={this.props.onClick} key='read-more'>
|
|
|
|
<FormattedMessage id='status.read_more' defaultMessage='Read more' /><Icon id='angle-right' icon={ChevronRightIcon} />
|
|
|
|
</button>
|
|
|
|
);
|
|
|
|
|
2022-10-25 18:47:21 +02:00
|
|
|
const translateButton = renderTranslate && (
|
|
|
|
<TranslateButton onClick={this.handleTranslate} translation={status.get('translation')} />
|
2022-09-23 23:00:12 +02:00
|
|
|
);
|
|
|
|
|
2024-12-29 19:59:19 +01:00
|
|
|
const poll = !!status.get('poll') && (
|
|
|
|
<PollContainer pollId={status.get('poll')} status={status} lang={language} />
|
|
|
|
);
|
2017-02-05 04:11:14 +01:00
|
|
|
|
2024-12-29 19:59:19 +01:00
|
|
|
if (this.props.onClick) {
|
2017-01-25 00:49:08 +01:00
|
|
|
return (
|
2024-12-29 19:59:19 +01:00
|
|
|
<>
|
|
|
|
<div className={classNames} ref={this.setRef} onMouseDown={this.handleMouseDown} onMouseUp={this.handleMouseUp} tabIndex={0} key='status-content' onMouseEnter={this.handleMouseEnter} onMouseLeave={this.handleMouseLeave}>
|
|
|
|
<div className='status__content__text status__content__text--visible translate' lang={language} dangerouslySetInnerHTML={content} />
|
|
|
|
|
|
|
|
{poll}
|
|
|
|
{translateButton}
|
2017-06-25 19:15:03 -07:00
|
|
|
</div>
|
|
|
|
|
2024-12-22 20:27:32 +01:00
|
|
|
{readMoreButton}
|
2024-12-29 19:59:19 +01:00
|
|
|
</>
|
2017-01-25 00:49:08 +01:00
|
|
|
);
|
2017-04-10 14:31:26 -05:00
|
|
|
} else {
|
|
|
|
return (
|
2024-12-29 19:59:19 +01:00
|
|
|
<div className={classNames} ref={this.setRef} tabIndex={0} onMouseEnter={this.handleMouseEnter} onMouseLeave={this.handleMouseLeave}>
|
|
|
|
<div className='status__content__text status__content__text--visible translate' lang={language} dangerouslySetInnerHTML={content} />
|
|
|
|
|
|
|
|
{poll}
|
2022-11-30 15:03:47 +01:00
|
|
|
{translateButton}
|
2017-06-25 19:15:03 -07:00
|
|
|
</div>
|
2017-04-10 14:31:26 -05:00
|
|
|
);
|
2017-01-25 00:49:08 +01:00
|
|
|
}
|
2017-04-22 03:05:35 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2023-03-24 15:15:25 -07:00
|
|
|
|
2024-05-19 19:07:32 +02:00
|
|
|
export default withRouter(withIdentity(connect(mapStateToProps)(injectIntl(StatusContent))));
|