Tiny Status improvements

- Media toots are no longer auto-collapsed if the media is behind a CW
- Display names no longer appear clickable when a toot is collapsed
- Fixed #36 by adding reduplicating the media icon inside the SHOW
MORE/LESS
This commit is contained in:
kibigo!
2017-06-28 23:20:47 -07:00
parent 19690d3e33
commit 99889ea57d
3 changed files with 15 additions and 8 deletions

View File

@@ -20,6 +20,7 @@ export default class StatusContent extends React.PureComponent {
onExpandedToggle: PropTypes.func,
onHeightUpdate: PropTypes.func,
onClick: PropTypes.func,
mediaIcon: PropTypes.string,
children: PropTypes.element,
};
@@ -119,7 +120,7 @@ export default class StatusContent extends React.PureComponent {
}
render () {
const { status, children } = this.props;
const { status, children, mediaIcon } = this.props;
const hidden = this.props.onExpandedToggle ? !this.props.expanded : this.state.hidden;
@@ -151,7 +152,9 @@ export default class StatusContent extends React.PureComponent {
<p style={{ marginBottom: hidden && status.get('mentions').isEmpty() ? '0px' : null }}>
<span dangerouslySetInnerHTML={spoilerContent} />
{' '}
<button tabIndex='0' className='status__content__spoiler-link' onClick={this.handleSpoilerClick}>{toggleText}</button>
<button tabIndex='0' className='status__content__spoiler-link' onClick={this.handleSpoilerClick}>
{toggleText} {mediaIcon ? <i className={`fa fa-fw fa-${mediaIcon}`} aria-hidden='true' /> : null}
</button>
</p>
{mentionsPlaceholder}