|
|
@ -29,6 +29,7 @@ import { initReport } from 'flavours/glitch/actions/reports';
|
|
|
|
import { makeGetStatus } from 'flavours/glitch/selectors';
|
|
|
|
import { makeGetStatus } from 'flavours/glitch/selectors';
|
|
|
|
import { ScrollContainer } from 'react-router-scroll-4';
|
|
|
|
import { ScrollContainer } from 'react-router-scroll-4';
|
|
|
|
import ColumnBackButton from 'flavours/glitch/components/column_back_button';
|
|
|
|
import ColumnBackButton from 'flavours/glitch/components/column_back_button';
|
|
|
|
|
|
|
|
import ColumnHeader from '../../components/column_header';
|
|
|
|
import StatusContainer from 'flavours/glitch/containers/status_container';
|
|
|
|
import StatusContainer from 'flavours/glitch/containers/status_container';
|
|
|
|
import { openModal } from 'flavours/glitch/actions/modal';
|
|
|
|
import { openModal } from 'flavours/glitch/actions/modal';
|
|
|
|
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
|
|
|
|
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
|
|
|
@ -41,6 +42,8 @@ const messages = defineMessages({
|
|
|
|
deleteConfirm: { id: 'confirmations.delete.confirm', defaultMessage: 'Delete' },
|
|
|
|
deleteConfirm: { id: 'confirmations.delete.confirm', defaultMessage: 'Delete' },
|
|
|
|
deleteMessage: { id: 'confirmations.delete.message', defaultMessage: 'Are you sure you want to delete this status?' },
|
|
|
|
deleteMessage: { id: 'confirmations.delete.message', defaultMessage: 'Are you sure you want to delete this status?' },
|
|
|
|
blockConfirm: { id: 'confirmations.block.confirm', defaultMessage: 'Block' },
|
|
|
|
blockConfirm: { id: 'confirmations.block.confirm', defaultMessage: 'Block' },
|
|
|
|
|
|
|
|
revealAll: { id: 'status.show_more_all', defaultMessage: 'Show more for all' },
|
|
|
|
|
|
|
|
hideAll: { id: 'status.show_less_all', defaultMessage: 'Show less for all' },
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
const makeMapStateToProps = () => {
|
|
|
|
const makeMapStateToProps = () => {
|
|
|
@ -77,6 +80,7 @@ export default class Status extends ImmutablePureComponent {
|
|
|
|
state = {
|
|
|
|
state = {
|
|
|
|
fullscreen: false,
|
|
|
|
fullscreen: false,
|
|
|
|
isExpanded: false,
|
|
|
|
isExpanded: false,
|
|
|
|
|
|
|
|
threadExpanded: null,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
componentWillMount () {
|
|
|
|
componentWillMount () {
|
|
|
@ -190,6 +194,11 @@ export default class Status extends ImmutablePureComponent {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
handleToggleAll = () => {
|
|
|
|
|
|
|
|
const { isExpanded } = this.state;
|
|
|
|
|
|
|
|
this.setState({ isExpanded: !isExpanded, threadExpanded: !isExpanded });
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
handleBlockClick = (account) => {
|
|
|
|
handleBlockClick = (account) => {
|
|
|
|
const { dispatch, intl } = this.props;
|
|
|
|
const { dispatch, intl } = this.props;
|
|
|
|
|
|
|
|
|
|
|
@ -285,6 +294,7 @@ export default class Status extends ImmutablePureComponent {
|
|
|
|
<StatusContainer
|
|
|
|
<StatusContainer
|
|
|
|
key={id}
|
|
|
|
key={id}
|
|
|
|
id={id}
|
|
|
|
id={id}
|
|
|
|
|
|
|
|
expanded={this.state.threadExpanded}
|
|
|
|
onMoveUp={this.handleMoveUp}
|
|
|
|
onMoveUp={this.handleMoveUp}
|
|
|
|
onMoveDown={this.handleMoveDown}
|
|
|
|
onMoveDown={this.handleMoveDown}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
@ -327,7 +337,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 } = this.props;
|
|
|
|
const { status, settings, ancestorsIds, descendantsIds, intl } = this.props;
|
|
|
|
const { fullscreen, isExpanded } = this.state;
|
|
|
|
const { fullscreen, isExpanded } = this.state;
|
|
|
|
|
|
|
|
|
|
|
|
if (status === null) {
|
|
|
|
if (status === null) {
|
|
|
@ -360,7 +370,12 @@ export default class Status extends ImmutablePureComponent {
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<Column>
|
|
|
|
<Column>
|
|
|
|
<ColumnBackButton />
|
|
|
|
<ColumnHeader
|
|
|
|
|
|
|
|
showBackButton
|
|
|
|
|
|
|
|
extraButton={(
|
|
|
|
|
|
|
|
<button className='column-header__button' title={intl.formatMessage(!isExpanded ? messages.revealAll : messages.hideAll)} aria-label={intl.formatMessage(!isExpanded ? messages.revealAll : messages.hideAll)} onClick={this.handleToggleAll} aria-pressed={!isExpanded ? 'false' : 'true'}><i className={`fa fa-${!isExpanded ? 'eye-slash' : 'eye'}`} /></button>
|
|
|
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
|
|
<ScrollContainer scrollKey='thread'>
|
|
|
|
<ScrollContainer scrollKey='thread'>
|
|
|
|
<div className={classNames('scrollable', 'detailed-status__wrapper', { fullscreen })} ref={this.setRef}>
|
|
|
|
<div className={classNames('scrollable', 'detailed-status__wrapper', { fullscreen })} ref={this.setRef}>
|
|
|
@ -374,7 +389,7 @@ export default class Status extends ImmutablePureComponent {
|
|
|
|
onOpenVideo={this.handleOpenVideo}
|
|
|
|
onOpenVideo={this.handleOpenVideo}
|
|
|
|
onOpenMedia={this.handleOpenMedia}
|
|
|
|
onOpenMedia={this.handleOpenMedia}
|
|
|
|
expanded={isExpanded}
|
|
|
|
expanded={isExpanded}
|
|
|
|
setExpansion={setExpansion}
|
|
|
|
onToggleHidden={this.handleExpandedToggle}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
|
|
<ActionBar
|
|
|
|
<ActionBar
|
|
|
|