-
Notifications
You must be signed in to change notification settings - Fork 5
Notifications: Notification popup appeared, but zero in list screen #415
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…tifications BE endpoint; WIP.
Added notification button to sidebar. |
@@ -417,6 +417,24 @@ function Sidebar(props: any) { | |||
</div> | |||
)} | |||
|
|||
<div className="mb-2"> | |||
<Link href={`/${locale}/notification`}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -97,42 +104,44 @@ export default function NotificationPage() { | |||
}, [currentUser?.pi_uid]); | |||
|
|||
useEffect(() => { | |||
if (observer.current) observer.current.disconnect(); | |||
if (loadMoreObserver.current) loadMoreObserver.current.disconnect(); | |||
if (!currentUser?.pi_uid || !hasMore) return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice @adisa39!
A refactor suggestion.. what are your thoughts about extracting this behavior into a custom hook so it can be reusable in any list-based screens? I figure we could call it useInfiniteScroll.ts and place it into a /hooks folder.
Is that something you want to try coding, or would you prefer that I do it? Let me know!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR changes look good @adisa39! Good job! 👍
I left a comment suggesting a possible refactoring opportunity that may be considered. But for the sake of time, I'm totally fine with revisiting it later, if you feel so. Feel free to approve so I can proceed with the merge. Thanks again!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Solid cleanup 👍
const response = await axiosClient.get(`/notifications/${pi_uid}?skip=${skip}&limit=${limit}`, { | ||
headers, | ||
|
||
const queryParams = new URLSearchParams({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Just a small naming issue at 'show={setShowNotificationPopup}'
One thing I also noticed — the text in the input fields doesn’t overflow or become scrollable, which prevents users from seeing the entire content if it's too long. I'll plan to look into this when I get a chance, unless someone else gets to it first. We may want to implement this in our other existing input fields as well. |
Nevermind; user error. Looks like the fields are scrollable.. though may not be intuitive for users. |
I went ahead and extracted the pagination-related useEffect into its own custom hook and tested it with the Notification feature, which appears to be working well. We can plan to reuse this hook for the other pagination-driven pages and regression test when we get to the technical debt cleanup task @ https://sharing.clickup.com/9015444408/t/h/86c4p227d/KKLUOY257LSYH0K |
Hi @DarinHajou - it appears the PR is locked due to your requested change(s), which I believe have been addressed now. Could you please re-review when you can? Thanks for your contribution! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved after talking to Danny
FE adjustments for proper integration with amended getNotifications endpoint.
[see commits]