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,35 +10,8 @@ import ScrollableList from '../scrollable_list'
import TrendsItem from '../trends_item'
import TrendsItemPlaceholder from '../placeholder/trends_item_placeholder'
const messages = defineMessages({
title: { id: 'trends.title', defaultMessage: 'Trending right now' },
readMore: { id: 'status.read_more', defaultMessage: 'Read more' },
})
const mapStateToProps = (state) => ({
isError: state.getIn(['gab_trends', 'feed', 'isError']),
isLoading: state.getIn(['gab_trends', 'feed', 'isLoading']),
items: state.getIn(['gab_trends', 'feed', 'items']),
})
const mapDispatchToProps = (dispatch) => ({
onfetchGabTrends: () => dispatch(fetchGabTrends('feed')),
})
export default
@injectIntl
@connect(mapStateToProps, mapDispatchToProps)
class TrendsPanel extends ImmutablePureComponent {
static propTypes = {
intl: PropTypes.object.isRequired,
isError: PropTypes.bool,
isLazy: PropTypes.bool,
isLoading: PropTypes.bool,
items: ImmutablePropTypes.list.isRequired,
onfetchGabTrends: PropTypes.func.isRequired,
}
updateOnProps = [
'items',
'isLazy',
@@ -116,4 +89,30 @@ class TrendsPanel extends ImmutablePureComponent {
</PanelLayout>
)
}
}
}
const messages = defineMessages({
title: { id: 'trends.title', defaultMessage: 'Trending right now' },
readMore: { id: 'status.read_more', defaultMessage: 'Read more' },
})
const mapStateToProps = (state) => ({
isError: state.getIn(['gab_trends', 'feed', 'isError']),
isLoading: state.getIn(['gab_trends', 'feed', 'isLoading']),
items: state.getIn(['gab_trends', 'feed', 'items']),
})
const mapDispatchToProps = (dispatch) => ({
onfetchGabTrends: () => dispatch(fetchGabTrends('feed')),
})
TrendsPanel.propTypes = {
intl: PropTypes.object.isRequired,
isError: PropTypes.bool,
isLazy: PropTypes.bool,
isLoading: PropTypes.bool,
items: ImmutablePropTypes.list.isRequired,
onfetchGabTrends: PropTypes.func.isRequired,
}
export default injectIntl(connect(mapStateToProps, mapDispatchToProps)(TrendsPanel))