Closed joshwingreene closed 1 year ago
@DropsOfSerenity Okay. I have finished adding the notification button to the left of the hamburger button on mobile. While implementing this change, I realized that I hadn't sufficiently resolved a duplicate key issue that was related to the useInfiniteLoading hook and the Read Notifications component. So, I had to fix that.
Summary of the Changes
NotificationButton
into its own componentNotificationButton
will now be shown to the left of the hamburger button on mobile.ReadNotifications
component now makes use of the useInfiniteLoading
hook.useInfiniteLoading
hook now handles the clearing of the loadedData const. This was the fix for the aforementioned duplicate key issue.Here's a demo:
https://user-images.githubusercontent.com/2876874/207737401-8924c9e1-d4dc-435d-922f-2118d01212b4.mov
Some Notes
Changes
NotificationDropdown
component. It will appear when the notification button is clicked.noContentStyles
class to the NoContentStyles styled component for styling purposesNoContentStyles
styled component will now set the color of paragraph elements that have thelead
class.NotificationButton
into its own componentNotificationButton
will now be shown to the left of the hamburger button on mobile.ReadNotifications
component now makes use of theuseInfiniteLoading
hook.useInfiniteLoading
hook now handles the clearing of the loadedData const. This was the fix for the aforementioned duplicate key issue.Purpose
Approach
Notable Issue
@DropsOfSerenity It doesn't happen all of the time, but the notification dropdown will sometimes show on mobile when you click on the hamburger icon. I originally thought that the notification button in the hidden navbar was being clicked even though its visibility is set to hidden. However, it doesn't look like that's possible. Do you know what might be going on?
Learning
Testing Steps
Screenshots/Demo
https://user-images.githubusercontent.com/2876874/206277207-747e3a1f-40d0-4a03-8484-8f93aa3505bb.mov