diff options
author | ankit-thanekar007 <ankit.thanekar007@gmail.com> | 2021-03-15 13:56:33 -0700 |
---|---|---|
committer | ankit-thanekar007 <ankit.thanekar007@gmail.com> | 2021-03-15 13:56:33 -0700 |
commit | 664757ff9f48bddccf3accea3c11c367f3d141c8 (patch) | |
tree | 6b7aaa5ff16c612c9a00e18366f0eff87fb91ae2 | |
parent | 6962e44c64d96ccb3bd47a659bfb38c14c765132 (diff) |
TMA 643: FR changes
-rw-r--r-- | src/screens/main/NotificationsScreen.tsx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/screens/main/NotificationsScreen.tsx b/src/screens/main/NotificationsScreen.tsx index 675d415d..ed6c246e 100644 --- a/src/screens/main/NotificationsScreen.tsx +++ b/src/screens/main/NotificationsScreen.tsx @@ -58,7 +58,7 @@ const NotificationsScreen: React.FC = () => { const DEFAULT_NOTIFICATIONS_SIZE = 2; const [moreFooterEnabled, setMoreFooterEnabled] = useState(false); - const [requestLimit, setrequestLimit] = useState(DEFAULT_NOTIFICATIONS_SIZE); + const [requestLimit, setRequestLimit] = useState(DEFAULT_NOTIFICATIONS_SIZE); const [allFriendRequests, setFriendRequests] = useState<NotificationType[]>( [], ); @@ -154,6 +154,7 @@ const NotificationsScreen: React.FC = () => { } } setFriendRequests(friendRequests); + setMoreFooterEnabled(requestLimit === friendRequests.length); setSectionedNotifications( todays.length === 0 && yesterdays.length === 0 && @@ -209,8 +210,7 @@ const NotificationsScreen: React.FC = () => { <TouchableOpacity style={styles.sectionHeaderContainer} onPress={() => { - setrequestLimit(DEFAULT_NOTIFICATIONS_SIZE); - setMoreFooterEnabled(false); + setRequestLimit(DEFAULT_NOTIFICATIONS_SIZE); }}> <View style={[styles.sectionLocation, styles.hiddenSectionContainer]}> @@ -231,8 +231,7 @@ const NotificationsScreen: React.FC = () => { <TouchableOpacity style={styles.sectionHeaderContainer} onPress={() => { - setrequestLimit(allFriendRequests.length); - setMoreFooterEnabled(true); + setRequestLimit(allFriendRequests.length); }}> <Text style={[ |