Added new sorting for "Hot" in GroupCollection, GroupTimeline

• Added:
- new sorting for "Hot" in GroupCollection, GroupTimeline
This commit is contained in:
mgabdev
2020-08-10 22:16:08 -05:00
parent 5f6a2e9cab
commit b2c69afdbd
6 changed files with 39 additions and 14 deletions

View File

@@ -9,11 +9,9 @@ import {
} from '../actions/timelines'
import {
setGroupTimelineSort,
setGroupTimelineTopSort,
} from '../actions/groups'
import {
GROUP_TIMELINE_SORTING_TYPE_TOP,
GROUP_TIMELINE_SORTING_TYPE_TOP_OPTION_TODAY,
GROUP_TIMELINE_SORTING_TYPE_HOT,
GROUP_TIMELINE_SORTING_TYPE_NEWEST,
} from '../constants'
import getSortBy from '../utils/group_sort_by'
@@ -53,8 +51,7 @@ const mapDispatchToProps = (dispatch) => ({
dispatch(expandGroupCollectionTimeline(collectionType, options))
},
setFeaturedTop() {
dispatch(setGroupTimelineSort(GROUP_TIMELINE_SORTING_TYPE_TOP))
dispatch(setGroupTimelineTopSort(GROUP_TIMELINE_SORTING_TYPE_TOP_OPTION_TODAY))
dispatch(setGroupTimelineSort(GROUP_TIMELINE_SORTING_TYPE_HOT))
},
setMemberNewest() {
dispatch(setGroupTimelineSort(GROUP_TIMELINE_SORTING_TYPE_NEWEST))
@@ -115,7 +112,7 @@ class GroupCollectionTimeline extends PureComponent {
sortByTopValue,
} = this.props
if (this.props.collectionType === 'featured' && sortByValue !== GROUP_TIMELINE_SORTING_TYPE_TOP) {
if (this.props.collectionType === 'featured' && sortByValue !== GROUP_TIMELINE_SORTING_TYPE_HOT) {
this.props.setFeaturedTop()
} else if (!!me && this.props.collectionType === 'member' && sortByValue !== GROUP_TIMELINE_SORTING_TYPE_NEWEST) {
this.props.setMemberNewest()