feat(notification): enhance NotificationDetailsPage and Notification component with improved UI and functionality

- Refactored NotificationDetailsPage to utilize a presenter hook for better state management and loading handling.
- Improved UI elements in NotificationDetailsPage, including a hero header and detail grid for displaying notification information.
- Updated Notification component to streamline the marking of notifications as seen and enhance the display of notification details.
- Added gradient backgrounds and improved tooltip functionality for better visual feedback and user experience.
This commit is contained in:
AmirReza Jamali
2026-06-03 16:34:43 +03:30
parent bb3695ee74
commit a99f86b2f9
7 changed files with 553 additions and 63 deletions
+3
View File
@@ -124,6 +124,9 @@ export const useUpdateCustomer = (id: string) => {
queryClient.invalidateQueries({
queryKey: [API_ENDPOINTS.CUSTOMERS.READ_ALL],
});
queryClient.invalidateQueries({
queryKey: ["GET ALL CUSTOMERS", id],
});
router.push("/customers");
},
});
+3 -10
View File
@@ -28,18 +28,11 @@ export const useGetMyNotifications = (params?: Record<string, any>) => {
queryFn: () => notificationService.getMyNotifications(params),
});
};
export const useMarkNotificationAsSeen = (
id: string,
successCallback?: () => void,
) => {
export const useMarkNotificationAsSeen = (successCallback?: () => void) => {
const queryClient = useQueryClient();
const mutationKey = useMemo(
() => [API_ENDPOINTS.NOTIFICATIONS.MARK_AS_SEEN(id), id],
[id],
);
return useMutation({
mutationKey,
mutationFn: () => notificationService.markNotificationAsSeen(id),
mutationKey: ["MARK_NOTIFICATION_AS_SEEN"],
mutationFn: (id: string) => notificationService.markNotificationAsSeen(id),
onSuccess: () => {
if (successCallback) {
successCallback();