Finished updating the reformatting of propTypes and set redux, intl functions to end of component

• Finished:
- updating the reformatting of propTypes and set redux, intl functions to end of component

• Removed:
- Gif implementation
This commit is contained in:
mgabdev
2020-08-18 19:22:15 -05:00
parent e21a6ff897
commit 99982c0391
102 changed files with 2540 additions and 3285 deletions

View File

@@ -10,34 +10,8 @@ import {
} from '../actions/timelines'
import StatusList from '../components/status_list'
const messages = defineMessages({
title: { id: 'column.home', defaultMessage: 'Home' },
empty: { id: 'empty_timeline.home', defaultMessage: 'Your home timeline is empty. Start following other users to receive their content here.' },
})
const mapStateToProps = (state) => ({
isPartial: state.getIn(['timelines', 'home', 'isPartial']),
})
const mapDispatchToProps = (dispatch) => ({
onExpandHomeTimeline(options) {
if (!options) dispatch(forceDequeueTimeline('home'))
dispatch(expandHomeTimeline(options))
},
})
export default
@injectIntl
@withRouter
@connect(mapStateToProps, mapDispatchToProps)
class HomeTimeline extends React.PureComponent {
static propTypes = {
intl: PropTypes.object.isRequired,
isPartial: PropTypes.bool,
onExpandHomeTimeline: PropTypes.func.isRequired,
}
componentDidMount () {
this._checkIfReloadNeeded(false, this.props.isPartial)
}
@@ -99,4 +73,28 @@ class HomeTimeline extends React.PureComponent {
)
}
}
}
const messages = defineMessages({
title: { id: 'column.home', defaultMessage: 'Home' },
empty: { id: 'empty_timeline.home', defaultMessage: 'Your home timeline is empty. Start following other users to receive their content here.' },
})
const mapStateToProps = (state) => ({
isPartial: state.getIn(['timelines', 'home', 'isPartial']),
})
const mapDispatchToProps = (dispatch) => ({
onExpandHomeTimeline(options) {
if (!options) dispatch(forceDequeueTimeline('home'))
dispatch(expandHomeTimeline(options))
},
})
HomeTimeline.propTypes = {
intl: PropTypes.object.isRequired,
isPartial: PropTypes.bool,
onExpandHomeTimeline: PropTypes.func.isRequired,
}
export default injectIntl(withRouter(connect(mapStateToProps, mapDispatchToProps)(HomeTimeline)))