0
0
Fork 0

Change layout of posts in web UI (#19423)

This commit is contained in:
Eugen Rochko 2022-10-25 19:02:21 +02:00 committed by GitHub
parent fcca781aae
commit 0ca29eaa3f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 195 additions and 357 deletions

View file

@ -58,7 +58,6 @@ class StatusContent extends React.PureComponent {
static propTypes = {
status: ImmutablePropTypes.map.isRequired,
expanded: PropTypes.bool,
showThread: PropTypes.bool,
onExpandedToggle: PropTypes.func,
onTranslate: PropTypes.func,
onClick: PropTypes.func,
@ -214,7 +213,6 @@ class StatusContent extends React.PureComponent {
const hidden = this.props.onExpandedToggle ? !this.props.expanded : this.state.hidden;
const renderReadMore = this.props.onClick && status.get('collapsed');
const renderViewThread = this.props.showThread && status.get('in_reply_to_id') && status.get('in_reply_to_account_id') === status.getIn(['account', 'id']);
const renderTranslate = translationEnabled && this.context.identity.signedIn && this.props.onTranslate && ['public', 'unlisted'].includes(status.get('visibility')) && status.get('contentHtml').length > 0 && status.get('language') !== null && intl.locale !== status.get('language');
const content = { __html: status.get('translation') ? status.getIn(['translation', 'content']) : status.get('contentHtml') };
@ -226,12 +224,6 @@ class StatusContent extends React.PureComponent {
'status__content--collapsed': renderReadMore,
});
const showThreadButton = renderViewThread && (
<button className='status__content__read-more-button' onClick={this.props.onClick}>
<FormattedMessage id='status.show_thread' defaultMessage='Show thread' />
</button>
);
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' fixedWidth />
@ -275,7 +267,6 @@ class StatusContent extends React.PureComponent {
{!hidden && poll}
{!hidden && translateButton}
{showThreadButton}
</div>
);
} else if (this.props.onClick) {
@ -286,7 +277,6 @@ class StatusContent extends React.PureComponent {
{poll}
{translateButton}
{showThreadButton}
</div>
{readMoreButton}
@ -299,7 +289,6 @@ class StatusContent extends React.PureComponent {
{poll}
{translateButton}
{showThreadButton}
</div>
);
}