From e37876aa86c0ffdeb9aa9f43bf4f1f0b542331a4 Mon Sep 17 00:00:00 2001
From: mgabdev <>
Date: Fri, 12 Jun 2020 21:52:26 -0400
Subject: [PATCH] Updated Notifications follows tab to be ungrouped list
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
• Updated:
- Notifications for new follows to be ungrouped, in a list when on the "Follows" tab
---
.../gabsocial/features/notifications.js | 26 ++++++++++++++++---
1 file changed, 23 insertions(+), 3 deletions(-)
diff --git a/app/javascript/gabsocial/features/notifications.js b/app/javascript/gabsocial/features/notifications.js
index 387089c7..583dda02 100644
--- a/app/javascript/gabsocial/features/notifications.js
+++ b/app/javascript/gabsocial/features/notifications.js
@@ -15,6 +15,7 @@ import NotificationContainer from '../containers/notification_container'
import ScrollableList from '../components/scrollable_list'
import TimelineQueueButtonHeader from '../components/timeline_queue_button_header'
import Block from '../components/block'
+import Account from '../components/account'
const mapStateToProps = (state) => ({
notifications: state.getIn(['notifications', 'items']),
@@ -22,6 +23,7 @@ const mapStateToProps = (state) => ({
isLoading: state.getIn(['notifications', 'isLoading'], true),
hasMore: state.getIn(['notifications', 'hasMore']),
totalQueuedNotificationsCount: state.getIn(['notifications', 'totalQueuedNotificationsCount'], 0),
+ selectedFilter: state.getIn(['notifications', 'filter', 'active']),
})
const mapDispatchToProps = (dispatch) => ({
@@ -51,6 +53,7 @@ class Notifications extends ImmutablePureComponent {
onScrollTopNotifications: PropTypes.func.isRequired,
sortedNotifications: ImmutablePropTypes.list.isRequired,
totalQueuedNotificationsCount: PropTypes.number,
+ selectedFilter: PropTypes.string.isRequired,
}
componentWillUnmount() {
@@ -101,21 +104,38 @@ class Notifications extends ImmutablePureComponent {
isLoading,
hasMore,
totalQueuedNotificationsCount,
+ selectedFilter,
} = this.props
let scrollableContent = null
- // : todo : include follow requests
-
if (isLoading && this.scrollableContent) {
scrollableContent = this.scrollableContent
- } else if (sortedNotifications.size > 0 || hasMore) {
+ } else if ((sortedNotifications.size > 0 || hasMore) && selectedFilter !== 'follow') {
scrollableContent = sortedNotifications.map((item, index) => (
))
+ } else if ((sortedNotifications.size > 0 || hasMore) && selectedFilter === 'follow') {
+ const followNotifications = []
+ sortedNotifications.forEach((block) => {
+ block.get('follow').forEach((item) => {
+ followNotifications.push(item)
+ })
+ })
+
+ scrollableContent = followNotifications.map((item, index) => {
+ return (
+
+ )
+ })
}
this.scrollableContent = scrollableContent