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

@@ -12,35 +12,8 @@ import Block from '../components/block'
import ScrollableList from '../components/scrollable_list'
import Text from '../components/text'
const mapStateToProps = (state) => ({
accountIds: state.getIn(['user_lists', 'follow_requests', me, 'items']),
isLoading: state.getIn(['user_lists', 'follow_requests', me, 'isLoading']),
hasMore: !!state.getIn(['user_lists', 'follow_requests', me, 'next']),
locked: !!state.getIn(['accounts', me, 'locked']),
})
const mapDispatchToProps = (dispatch) => ({
onFetchFollowRequests() {
dispatch(fetchFollowRequests())
},
onExpandFollowRequests() {
dispatch(expandFollowRequests())
},
})
export default
@connect(mapStateToProps, mapDispatchToProps)
class FollowRequests extends ImmutablePureComponent {
static propTypes = {
accountIds: ImmutablePropTypes.list,
hasMore: PropTypes.bool,
isLoading: PropTypes.bool,
locked: PropTypes.bool,
onFetchFollowRequests: PropTypes.func.isRequired,
onExpandFollowRequests: PropTypes.func.isRequired,
}
componentWillMount () {
this.props.onFetchFollowRequests()
}
@@ -91,3 +64,30 @@ class FollowRequests extends ImmutablePureComponent {
}
}
const mapStateToProps = (state) => ({
accountIds: state.getIn(['user_lists', 'follow_requests', me, 'items']),
isLoading: state.getIn(['user_lists', 'follow_requests', me, 'isLoading']),
hasMore: !!state.getIn(['user_lists', 'follow_requests', me, 'next']),
locked: !!state.getIn(['accounts', me, 'locked']),
})
const mapDispatchToProps = (dispatch) => ({
onFetchFollowRequests() {
dispatch(fetchFollowRequests())
},
onExpandFollowRequests() {
dispatch(expandFollowRequests())
},
})
FollowRequests.propTypes = {
accountIds: ImmutablePropTypes.list,
hasMore: PropTypes.bool,
isLoading: PropTypes.bool,
locked: PropTypes.bool,
onFetchFollowRequests: PropTypes.func.isRequired,
onExpandFollowRequests: PropTypes.func.isRequired,
}
export default connect(mapStateToProps, mapDispatchToProps)(FollowRequests)