-
Notifications
You must be signed in to change notification settings - Fork 507
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
Replace useDispatch w. useQuery/request: Notifications (src/Components/Notifications/**) #6392 #6543
Conversation
…on the comments, add model.tsx in to folder notifications and add references into api.tsx
…patch with useQuery
…patch with useQuery, delete all commnets of old code
…lete all commnets of old code
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
✅ Deploy Preview for care-egov-staging ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@adriansliva could you also rebase and clear the merge conflicts? |
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.
Other than that, everything LGTM
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 work @adriansliva
LGTM
lgtm |
WHAT
🤖 Generated by Copilot at 97346d7
This pull request refactors the notifications components to use custom hooks and functions for fetching and handling data from the API, and adds TypeScript interfaces and ESLint configuration for improving the code quality and readability. It modifies the files
NoticeBoard.tsx
,NotificationsList.tsx
,ShowPushNotification.tsx
,api.tsx
,.eslintrc.js
andmodels.tsx
.This pull request improves the code quality and readability of the Notifications components.
Proposed Changes
useDispatch
w.useQuery
/request
: Notifications (src/Components/Notifications/**
) #6392@coronasafe/care-fe-code-reviewers @coronasafe/code-reviewers
Merge Checklist
HOW
🤖 Generated by Copilot at 97346d7
dispatch
calls withuseQuery
hook to fetch notifications data inNoticeBoard
component (link, link)useEffect
,useState
anduseDispatch
fromNoticeBoard
andNotificationsList
components (link, link)request
function androutes
object to make API requests and specify types inNotificationsList
component (link)dispatch
calls withrequest
function to mark notifications as read, get and update push notification configuration, and get public key inNotificationsList
component (link, link, link, link, link, link, link)dispatch
variables fromNotificationTile
andNotificationsList
components (link, link)dispatch
dependency fromuseEffect
hook inNotificationsList
component (link)useDispatch
hook withuseQuery
hook to fetch notification data and redirect inShowPushNotification
component (link)useEffect
hook fromShowPushNotification
component as it is redundant (link)method
andTRes
properties to notification routes inroutes
object to specify HTTP methods and response types (link, link, link)models
file inapi.tsx
file to use them for route types (link)