-
Notifications
You must be signed in to change notification settings - Fork 1
/
Notifications.tsx
30 lines (26 loc) · 973 Bytes
/
Notifications.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import { useQuery } from "react-query";
import { getNotifications } from "../../Services/notification";
import Notification from "../../Components/Notification/Notification";
import styles from "./Notifications.module.scss";
function Notifications() {
const gameId: string = "841cbf45-90cc-47b7-a763-fa3a18218bf9";
const { data: notifications, isLoading: isLoadingnotifications } = useQuery(
["notifications", gameId],
() => getNotifications({ userId: gameId! })
);
return (
<div className={styles.notificationPage}>
<div className={styles.notificationContainer}>
<div className={styles.notificationTitle}>Notifications</div>
{!isLoadingnotifications &&
notifications.map(
(notification: any) =>
!notification.isDeleted && (
<Notification props={notification} key={notification.id} />
)
)}
</div>
</div>
);
}
export default Notifications;