Removed unused code from GroupTimeline feature
• Removed: - unused code from GroupTimeline feature
This commit is contained in:
parent
5329e81d43
commit
19b86ccc8b
@ -1,8 +1,6 @@
|
|||||||
import ImmutablePureComponent from 'react-immutable-pure-component'
|
import ImmutablePureComponent from 'react-immutable-pure-component'
|
||||||
import ImmutablePropTypes from 'react-immutable-proptypes'
|
import ImmutablePropTypes from 'react-immutable-proptypes'
|
||||||
import { injectIntl, defineMessages } from 'react-intl'
|
import { injectIntl, defineMessages } from 'react-intl'
|
||||||
import { Link } from 'react-router-dom'
|
|
||||||
import classNames from 'classnames'
|
|
||||||
import { me } from '../initial_state'
|
import { me } from '../initial_state'
|
||||||
import { connectGroupStream } from '../actions/streaming'
|
import { connectGroupStream } from '../actions/streaming'
|
||||||
import { expandGroupTimeline } from '../actions/timelines'
|
import { expandGroupTimeline } from '../actions/timelines'
|
||||||
@ -10,16 +8,11 @@ import StatusList from '../components/status_list'
|
|||||||
import ColumnIndicator from '../components/column_indicator'
|
import ColumnIndicator from '../components/column_indicator'
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
tabLatest: { id: 'group.timeline.tab_latest', defaultMessage: 'Latest' },
|
|
||||||
show: { id: 'group.timeline.show_settings', defaultMessage: 'Show settings' },
|
|
||||||
hide: { id: 'group.timeline.hide_settings', defaultMessage: 'Hide settings' },
|
|
||||||
empty: { id: 'empty_column.group', defaultMessage: 'There is nothing in this group yet.\nWhen members of this group post new statuses, they will appear here.' },
|
empty: { id: 'empty_column.group', defaultMessage: 'There is nothing in this group yet.\nWhen members of this group post new statuses, they will appear here.' },
|
||||||
})
|
})
|
||||||
|
|
||||||
const mapStateToProps = (state, props) => ({
|
const mapStateToProps = (state, props) => ({
|
||||||
group: state.getIn(['groups', props.params.id]),
|
group: state.getIn(['groups', props.params.id]),
|
||||||
relationships: state.getIn(['group_relationships', props.params.id]),
|
|
||||||
hasUnread: state.getIn(['timelines', `group:${props.params.id}`, 'unread']) > 0,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
export default
|
export default
|
||||||
@ -27,26 +20,16 @@ export default
|
|||||||
@injectIntl
|
@injectIntl
|
||||||
class GroupTimeline extends ImmutablePureComponent {
|
class GroupTimeline extends ImmutablePureComponent {
|
||||||
|
|
||||||
static contextTypes = {
|
|
||||||
router: PropTypes.object,
|
|
||||||
}
|
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
params: PropTypes.object.isRequired,
|
params: PropTypes.object.isRequired,
|
||||||
dispatch: PropTypes.func.isRequired,
|
dispatch: PropTypes.func.isRequired,
|
||||||
hasUnread: PropTypes.bool,
|
|
||||||
group: PropTypes.oneOfType([
|
group: PropTypes.oneOfType([
|
||||||
ImmutablePropTypes.map,
|
ImmutablePropTypes.map,
|
||||||
PropTypes.bool,
|
PropTypes.bool,
|
||||||
]),
|
]),
|
||||||
relationships: ImmutablePropTypes.map,
|
|
||||||
intl: PropTypes.object.isRequired,
|
intl: PropTypes.object.isRequired,
|
||||||
}
|
}
|
||||||
|
|
||||||
state = {
|
|
||||||
collapsed: true,
|
|
||||||
}
|
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
const { dispatch } = this.props
|
const { dispatch } = this.props
|
||||||
const { id } = this.props.params
|
const { id } = this.props.params
|
||||||
@ -70,14 +53,8 @@ class GroupTimeline extends ImmutablePureComponent {
|
|||||||
this.props.dispatch(expandGroupTimeline(id, { maxId }))
|
this.props.dispatch(expandGroupTimeline(id, { maxId }))
|
||||||
}
|
}
|
||||||
|
|
||||||
handleToggleClick = (e) => {
|
|
||||||
e.stopPropagation()
|
|
||||||
this.setState({ collapsed: !this.state.collapsed })
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { group, relationships, account, intl } = this.props
|
const { group, intl } = this.props
|
||||||
const { collapsed } = this.state
|
|
||||||
const { id } = this.props.params
|
const { id } = this.props.params
|
||||||
|
|
||||||
if (typeof group === 'undefined') {
|
if (typeof group === 'undefined') {
|
||||||
@ -88,11 +65,9 @@ class GroupTimeline extends ImmutablePureComponent {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<StatusList
|
<StatusList
|
||||||
alwaysPrepend
|
scrollKey={`group-timeline-${id}`}
|
||||||
scrollKey={`group_timeline-${id}`}
|
|
||||||
timelineId={`group:${id}`}
|
timelineId={`group:${id}`}
|
||||||
onLoadMore={this.handleLoadMore}
|
onLoadMore={this.handleLoadMore}
|
||||||
group={group}
|
|
||||||
emptyMessage={intl.formatMessage(messages.empty)}
|
emptyMessage={intl.formatMessage(messages.empty)}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user