diff options
author | Ivan Chen <ivan@tagg.id> | 2021-01-15 20:53:49 -0500 |
---|---|---|
committer | Ivan Chen <ivan@tagg.id> | 2021-01-15 20:53:49 -0500 |
commit | 33b3bff63969e9da23722e8a70f60c5b94fe3cfb (patch) | |
tree | fe3902f4b6c33d3058145c257f7e044900120767 /src/screens/main/NotificationsScreen.tsx | |
parent | c2f9dfe523f446104bbf1ae08648f0527d5264b3 (diff) |
not fetching data in child component
Diffstat (limited to 'src/screens/main/NotificationsScreen.tsx')
-rw-r--r-- | src/screens/main/NotificationsScreen.tsx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/screens/main/NotificationsScreen.tsx b/src/screens/main/NotificationsScreen.tsx index da1e7a2b..219a0be9 100644 --- a/src/screens/main/NotificationsScreen.tsx +++ b/src/screens/main/NotificationsScreen.tsx @@ -18,6 +18,9 @@ import {getDateAge, SCREEN_HEIGHT} from '../../utils'; const NotificationsScreen: React.FC = () => { const {user: loggedInUser} = useSelector((state: RootState) => state.user); + const {moments: loggedInUserMoments} = useSelector( + (state: RootState) => state.moments, + ); const [refreshing, setRefreshing] = useState(false); // used for figuring out which ones are unread const [lastViewed, setLastViewed] = useState<moment.Moment | undefined>( @@ -96,7 +99,11 @@ const NotificationsScreen: React.FC = () => { }, [lastViewed, notifications]); const renderNotification = ({item}: {item: NotificationType}) => ( - <Notification item={item} screenType={ScreenType.Notifications} /> + <Notification + item={item} + screenType={ScreenType.Notifications} + moments={item.notification_type === 'CMT' ? loggedInUserMoments : []} + /> ); const renderSectionHeader = ({section: {title, data}}) => |