import React from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
+import classNames from 'classnames';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { fetchStatus } from '../../actions/statuses';
import MissingIndicator from '../../components/missing_indicator';
import ImmutablePureComponent from 'react-immutable-pure-component';
import { HotKeys } from 'react-hotkeys';
import { boostModal, deleteModal } from '../../initial_state';
+import { attachFullscreenListener, detachFullscreenListener, isFullscreen } from '../../features/ui/util/fullscreen';
const messages = defineMessages({
deleteConfirm: { id: 'confirmations.delete.confirm', defaultMessage: 'Delete' },
intl: PropTypes.object.isRequired,
};
+ state = {
+ fullscreen: false,
+ };
+
componentWillMount () {
this.props.dispatch(fetchStatus(this.props.params.statusId));
}
+ componentDidMount () {
+ attachFullscreenListener(this.onFullScreenChange);
+ }
+
componentWillReceiveProps (nextProps) {
if (nextProps.params.statusId !== this.props.params.statusId && nextProps.params.statusId) {
this._scrolledIntoView = false;
}
}
+ componentWillUnmount () {
+ detachFullscreenListener(this.onFullScreenChange);
+ }
+
+ onFullScreenChange = () => {
+ this.setState({ fullscreen: isFullscreen() });
+ }
+
render () {
let ancestors, descendants;
const { status, ancestorsIds, descendantsIds } = this.props;
+ const { fullscreen } = this.state;
if (status === null) {
return (
<ColumnBackButton />
<ScrollContainer scrollKey='thread'>
- <div className='scrollable detailed-status__wrapper' ref={this.setRef}>
+ <div className={classNames('scrollable', 'detailed-status__wrapper', { fullscreen })} ref={this.setRef}>
{ancestors}
<HotKeys handlers={handlers}>