mirror of https://github.com/Siphonay/mastodon
Reduce code and markup discrepancies on reply indicator
This commit is contained in:
parent
e023acfd00
commit
d3ae5b21d2
|
@ -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>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue