aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/screens/main/NotificationsScreen.tsx26
1 files changed, 9 insertions, 17 deletions
diff --git a/src/screens/main/NotificationsScreen.tsx b/src/screens/main/NotificationsScreen.tsx
index 2343215f..d6d47b02 100644
--- a/src/screens/main/NotificationsScreen.tsx
+++ b/src/screens/main/NotificationsScreen.tsx
@@ -88,18 +88,9 @@ const NotificationsScreen: React.FC = () => {
}
}
setSectionedNotifications([
- {
- title: 'Today',
- data: todays,
- },
- {
- title: 'Yesterday',
- data: yesterdays,
- },
- {
- title: 'This Week',
- data: thisWeeks,
- },
+ {title: 'Today', data: todays},
+ {title: 'Yesterday', data: yesterdays},
+ {title: 'This Week', data: thisWeeks},
]);
}, [lastViewed, notifications]);
@@ -107,11 +98,12 @@ const NotificationsScreen: React.FC = () => {
<Notification item={item} screenType={ScreenType.Notifications} />
);
- const renderSectionHeader = ({section: {title}}) => (
- <View style={styles.sectionHeaderContainer}>
- <Text style={styles.sectionHeader}>{title}</Text>
- </View>
- );
+ const renderSectionHeader = ({section: {title, data}}) =>
+ data.length !== 0 && (
+ <View style={styles.sectionHeaderContainer}>
+ <Text style={styles.sectionHeader}>{title}</Text>
+ </View>
+ );
return (
<SafeAreaView>