parent
3e8b623975
commit
02295257b3
|
@ -80,7 +80,7 @@ class HashtagTimeline extends React.PureComponent {
|
||||||
<div className='statuses-grid__item' key={statusId}>
|
<div className='statuses-grid__item' key={statusId}>
|
||||||
<DetailedStatusContainer
|
<DetailedStatusContainer
|
||||||
id={statusId}
|
id={statusId}
|
||||||
showThread
|
compact
|
||||||
measureHeight
|
measureHeight
|
||||||
onHeightChange={this.handleHeightChange}
|
onHeightChange={this.handleHeightChange}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -13,6 +13,7 @@ import ImmutablePureComponent from 'react-immutable-pure-component';
|
||||||
import Video from 'flavours/glitch/features/video';
|
import Video from 'flavours/glitch/features/video';
|
||||||
import VisibilityIcon from 'flavours/glitch/components/status_visibility_icon';
|
import VisibilityIcon from 'flavours/glitch/components/status_visibility_icon';
|
||||||
import scheduleIdleTask from 'flavours/glitch/util/schedule_idle_task';
|
import scheduleIdleTask from 'flavours/glitch/util/schedule_idle_task';
|
||||||
|
import classNames from 'classnames';
|
||||||
|
|
||||||
export default class DetailedStatus extends ImmutablePureComponent {
|
export default class DetailedStatus extends ImmutablePureComponent {
|
||||||
|
|
||||||
|
@ -30,6 +31,7 @@ export default class DetailedStatus extends ImmutablePureComponent {
|
||||||
measureHeight: PropTypes.bool,
|
measureHeight: PropTypes.bool,
|
||||||
onHeightChange: PropTypes.func,
|
onHeightChange: PropTypes.func,
|
||||||
domain: PropTypes.string.isRequired,
|
domain: PropTypes.string.isRequired,
|
||||||
|
compact: PropTypes.bool,
|
||||||
};
|
};
|
||||||
|
|
||||||
state = {
|
state = {
|
||||||
|
@ -60,7 +62,7 @@ export default class DetailedStatus extends ImmutablePureComponent {
|
||||||
|
|
||||||
_measureHeight (heightJustChanged) {
|
_measureHeight (heightJustChanged) {
|
||||||
if (this.props.measureHeight && this.node) {
|
if (this.props.measureHeight && this.node) {
|
||||||
scheduleIdleTask(() => this.node && this.setState({ height: this.node.offsetHeight }));
|
scheduleIdleTask(() => this.node && this.setState({ height: this.node.scrollHeight }));
|
||||||
|
|
||||||
if (this.props.onHeightChange && heightJustChanged) {
|
if (this.props.onHeightChange && heightJustChanged) {
|
||||||
this.props.onHeightChange();
|
this.props.onHeightChange();
|
||||||
|
@ -95,6 +97,7 @@ export default class DetailedStatus extends ImmutablePureComponent {
|
||||||
const status = this.props.status.get('reblog') ? this.props.status.get('reblog') : this.props.status;
|
const status = this.props.status.get('reblog') ? this.props.status.get('reblog') : this.props.status;
|
||||||
const { expanded, onToggleHidden, settings } = this.props;
|
const { expanded, onToggleHidden, settings } = this.props;
|
||||||
const outerStyle = { boxSizing: 'border-box' };
|
const outerStyle = { boxSizing: 'border-box' };
|
||||||
|
const { compact } = this.props;
|
||||||
|
|
||||||
if (!status) {
|
if (!status) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -200,7 +203,8 @@ export default class DetailedStatus extends ImmutablePureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div ref={this.setRef} className='detailed-status' data-status-by={status.getIn(['account', 'acct'])} style={outerStyle}>
|
<div style={outerStyle}>
|
||||||
|
<div ref={this.setRef} className={classNames('detailed-status', { compact })} data-status-by={status.getIn(['account', 'acct'])}>
|
||||||
<a href={status.getIn(['account', 'url'])} onClick={this.handleAccountClick} className='detailed-status__display-name'>
|
<a href={status.getIn(['account', 'url'])} onClick={this.handleAccountClick} className='detailed-status__display-name'>
|
||||||
<div className='detailed-status__display-avatar'><Avatar account={status.get('account')} size={48} /></div>
|
<div className='detailed-status__display-avatar'><Avatar account={status.get('account')} size={48} /></div>
|
||||||
<DisplayName account={status.get('account')} localDomain={this.props.domain} />
|
<DisplayName account={status.get('account')} localDomain={this.props.domain} />
|
||||||
|
@ -222,6 +226,7 @@ export default class DetailedStatus extends ImmutablePureComponent {
|
||||||
</a>{applicationLink} · {reblogLink} · {favouriteLink} · <VisibilityIcon visibility={status.get('visibility')} />
|
</a>{applicationLink} · {reblogLink} · {favouriteLink} · <VisibilityIcon visibility={status.get('visibility')} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -100,6 +100,7 @@ const makeMapStateToProps = () => {
|
||||||
descendantsIds,
|
descendantsIds,
|
||||||
settings: state.get('local_settings'),
|
settings: state.get('local_settings'),
|
||||||
askReplyConfirmation: state.getIn(['local_settings', 'confirm_before_clearing_draft']) && state.getIn(['compose', 'text']).trim().length !== 0,
|
askReplyConfirmation: state.getIn(['local_settings', 'confirm_before_clearing_draft']) && state.getIn(['compose', 'text']).trim().length !== 0,
|
||||||
|
domain: state.getIn(['meta', 'domain']),
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -123,6 +124,7 @@ export default class Status extends ImmutablePureComponent {
|
||||||
descendantsIds: ImmutablePropTypes.list,
|
descendantsIds: ImmutablePropTypes.list,
|
||||||
intl: PropTypes.object.isRequired,
|
intl: PropTypes.object.isRequired,
|
||||||
askReplyConfirmation: PropTypes.bool,
|
askReplyConfirmation: PropTypes.bool,
|
||||||
|
domain: PropTypes.string.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
state = {
|
state = {
|
||||||
|
@ -417,7 +419,7 @@ export default class Status extends ImmutablePureComponent {
|
||||||
render () {
|
render () {
|
||||||
let ancestors, descendants;
|
let ancestors, descendants;
|
||||||
const { setExpansion } = this;
|
const { setExpansion } = this;
|
||||||
const { status, settings, ancestorsIds, descendantsIds, intl } = this.props;
|
const { status, settings, ancestorsIds, descendantsIds, intl, domain } = this.props;
|
||||||
const { fullscreen, isExpanded } = this.state;
|
const { fullscreen, isExpanded } = this.state;
|
||||||
|
|
||||||
if (status === null) {
|
if (status === null) {
|
||||||
|
@ -470,6 +472,7 @@ export default class Status extends ImmutablePureComponent {
|
||||||
onOpenMedia={this.handleOpenMedia}
|
onOpenMedia={this.handleOpenMedia}
|
||||||
expanded={isExpanded}
|
expanded={isExpanded}
|
||||||
onToggleHidden={this.handleExpandedToggle}
|
onToggleHidden={this.handleExpandedToggle}
|
||||||
|
domain={domain}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<ActionBar
|
<ActionBar
|
||||||
|
|
|
@ -450,5 +450,33 @@ $fluid-breakpoint: $maximum-width + 20px;
|
||||||
@media screen and (max-width: $no-gap-breakpoint) {
|
@media screen and (max-width: $no-gap-breakpoint) {
|
||||||
border-bottom: 1px solid lighten($ui-base-color, 12%);
|
border-bottom: 1px solid lighten($ui-base-color, 12%);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.compact {
|
||||||
|
.detailed-status__meta {
|
||||||
|
margin-top: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status__content {
|
||||||
|
font-size: 15px;
|
||||||
|
line-height: 20px;
|
||||||
|
|
||||||
|
.emojione {
|
||||||
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
|
margin: -3px 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status__content__spoiler-link {
|
||||||
|
line-height: 20px;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.media-gallery,
|
||||||
|
.status-card,
|
||||||
|
.video-player {
|
||||||
|
margin-top: 15px;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue