Merge pull request #2471 from ClearlyClaire/glitch-soc/cleanup

Clean up some more and reduce unwarranted differences with upstream further
This commit is contained in:
Claire 2023-11-19 21:05:34 +01:00 committed by GitHub
commit c34a3a83e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 23 deletions

View File

@ -41,7 +41,7 @@ const messages = defineMessages({
class ComposeForm extends ImmutablePureComponent { class ComposeForm extends ImmutablePureComponent {
static propTypes = { static propTypes = {
intl: PropTypes.object.isRequired, intl: PropTypes.object.isRequired,
text: PropTypes.string, text: PropTypes.string.isRequired,
suggestions: ImmutablePropTypes.list, suggestions: ImmutablePropTypes.list,
spoiler: PropTypes.bool, spoiler: PropTypes.bool,
privacy: PropTypes.string, privacy: PropTypes.string,

View File

@ -6,8 +6,9 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component'; import ImmutablePureComponent from 'react-immutable-pure-component';
import AttachmentList from 'flavours/glitch/components/attachment_list'; import AttachmentList from 'flavours/glitch/components/attachment_list';
import { IconButton } from 'flavours/glitch/components/icon_button';
import AccountContainer from 'flavours/glitch/containers/account_container'; import { IconButton } from '../../../components/icon_button';
import AccountContainer from '../../../containers/account_container';
const messages = defineMessages({ const messages = defineMessages({
cancel: { id: 'reply_indicator.cancel', defaultMessage: 'Cancel' }, cancel: { id: 'reply_indicator.cancel', defaultMessage: 'Cancel' },
@ -17,8 +18,8 @@ class ReplyIndicator extends ImmutablePureComponent {
static propTypes = { static propTypes = {
status: ImmutablePropTypes.map, status: ImmutablePropTypes.map,
intl: PropTypes.object.isRequired,
onCancel: PropTypes.func, onCancel: PropTypes.func,
intl: PropTypes.object.isRequired,
}; };
handleClick = () => { handleClick = () => {
@ -35,38 +36,32 @@ class ReplyIndicator extends ImmutablePureComponent {
return null; return null;
} }
const content = { __html: status.get('contentHtml') };
const account = status.get('account'); const account = status.get('account');
const content = status.get('content');
const attachments = status.get('media_attachments');
return ( return (
<article className='reply-indicator'> <div className='reply-indicator'>
<header className='reply-indicator__header'> <div className='reply-indicator__header'>
<IconButton <div className='reply-indicator__cancel'><IconButton title={intl.formatMessage(messages.cancel)} icon='times' onClick={this.handleClick} inverted /></div>
className='reply-indicator__cancel'
icon='times'
onClick={this.handleClick}
title={intl.formatMessage(messages.cancel)}
inverted
/>
{account && ( {account && (
<AccountContainer <AccountContainer
id={account} id={account}
small small
/> />
)} )}
</header> </div>
<div
className='reply-indicator__content translate' <div className='reply-indicator__content translate' dangerouslySetInnerHTML={content} />
dangerouslySetInnerHTML={{ __html: content || '' }}
/> {status.get('media_attachments').size > 0 && (
{attachments.size > 0 && (
<AttachmentList <AttachmentList
compact compact
media={attachments} media={status.get('media_attachments')}
/> />
)} )}
</article> </div>
); );
} }