- {userNotifications?.map((notification) => (
-
- {notification.payload.data.asub}
- {notification.payload.data.amsg}
-
- ))}
-
-
Load more
+
+ {filteredNotifications?.map((notification) => (
+
+ ))}
+ {filteredNotifications.length !== userNotifications?.length && (
+
+ Load more
+
+ )}
)}
{(isLoadingSubscriptions ||
diff --git a/src/components/Notifications/NotificationItem.css b/src/components/Notifications/NotificationItem.css
new file mode 100644
index 000000000..3c8426224
--- /dev/null
+++ b/src/components/Notifications/NotificationItem.css
@@ -0,0 +1,11 @@
+.NotificationItem {
+ padding: 0 16px;
+}
+
+.NotificationItem__Text {
+ margin-bottom: 0;
+}
+
+.NotificationItem__Date {
+ text-transform: uppercase;
+}
diff --git a/src/components/Notifications/NotificationItem.tsx b/src/components/Notifications/NotificationItem.tsx
new file mode 100644
index 000000000..f54d85961
--- /dev/null
+++ b/src/components/Notifications/NotificationItem.tsx
@@ -0,0 +1,26 @@
+import Time from '../../utils/date/Time'
+import type { Notification } from '../../utils/notifications'
+import Link from '../Common/Typography/Link'
+import Text from '../Common/Typography/Text'
+
+import './NotificationItem.css'
+
+interface Props {
+ notification: Notification
+}
+
+export default function NotificationItem({ notification }: Props) {
+ const hasLink = !!notification.payload.data.acta
+ const Component = hasLink ? Link : 'div'
+
+ return (
+
+
+ {notification.payload.data.amsg}
+
+
+ {Time(notification.epoch).fromNow()}
+
+
+ )
+}
diff --git a/src/utils/notifications.ts b/src/utils/notifications.ts
index 991947e44..7df4ed419 100644
--- a/src/utils/notifications.ts
+++ b/src/utils/notifications.ts
@@ -1,8 +1,10 @@
// TODO: Move to notification types file
export type Notification = {
payload_id: number
+ epoch: string
payload: {
data: {
+ acta: string
asub: string
amsg: string
}