|
|
@ -71,6 +71,7 @@ export default class Status extends ImmutablePureComponent {
|
|
|
|
|
|
|
|
|
|
|
|
state = {
|
|
|
|
state = {
|
|
|
|
fullscreen: false,
|
|
|
|
fullscreen: false,
|
|
|
|
|
|
|
|
isExpanded: null,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
componentWillMount () {
|
|
|
|
componentWillMount () {
|
|
|
@ -88,6 +89,12 @@ export default class Status extends ImmutablePureComponent {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
handleExpandedToggle = () => {
|
|
|
|
|
|
|
|
if (this.props.status.get('spoiler_text')) {
|
|
|
|
|
|
|
|
this.setExpansion(this.state.isExpanded ? null : true);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
handleFavouriteClick = (status) => {
|
|
|
|
handleFavouriteClick = (status) => {
|
|
|
|
if (status.get('favourited')) {
|
|
|
|
if (status.get('favourited')) {
|
|
|
|
this.props.dispatch(unfavourite(status));
|
|
|
|
this.props.dispatch(unfavourite(status));
|
|
|
@ -241,6 +248,10 @@ export default class Status extends ImmutablePureComponent {
|
|
|
|
));
|
|
|
|
));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setExpansion = value => {
|
|
|
|
|
|
|
|
this.setState({ isExpanded: value ? true : null });
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
setRef = c => {
|
|
|
|
setRef = c => {
|
|
|
|
this.node = c;
|
|
|
|
this.node = c;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -272,8 +283,9 @@ export default class Status extends ImmutablePureComponent {
|
|
|
|
|
|
|
|
|
|
|
|
render () {
|
|
|
|
render () {
|
|
|
|
let ancestors, descendants;
|
|
|
|
let ancestors, descendants;
|
|
|
|
|
|
|
|
const { setExpansion } = this;
|
|
|
|
const { status, settings, ancestorsIds, descendantsIds } = this.props;
|
|
|
|
const { status, settings, ancestorsIds, descendantsIds } = this.props;
|
|
|
|
const { fullscreen } = this.state;
|
|
|
|
const { fullscreen, isExpanded } = this.state;
|
|
|
|
|
|
|
|
|
|
|
|
if (status === null) {
|
|
|
|
if (status === null) {
|
|
|
|
return (
|
|
|
|
return (
|
|
|
@ -300,6 +312,7 @@ export default class Status extends ImmutablePureComponent {
|
|
|
|
boost: this.handleHotkeyBoost,
|
|
|
|
boost: this.handleHotkeyBoost,
|
|
|
|
mention: this.handleHotkeyMention,
|
|
|
|
mention: this.handleHotkeyMention,
|
|
|
|
openProfile: this.handleHotkeyOpenProfile,
|
|
|
|
openProfile: this.handleHotkeyOpenProfile,
|
|
|
|
|
|
|
|
toggleSpoiler: this.handleExpandedToggle,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
@ -317,6 +330,8 @@ export default class Status extends ImmutablePureComponent {
|
|
|
|
settings={settings}
|
|
|
|
settings={settings}
|
|
|
|
onOpenVideo={this.handleOpenVideo}
|
|
|
|
onOpenVideo={this.handleOpenVideo}
|
|
|
|
onOpenMedia={this.handleOpenMedia}
|
|
|
|
onOpenMedia={this.handleOpenMedia}
|
|
|
|
|
|
|
|
expanded={isExpanded}
|
|
|
|
|
|
|
|
setExpansion={setExpansion}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
|
|
<ActionBar
|
|
|
|
<ActionBar
|
|
|
|