From 523fd1a0bab44e7fdee447aa65fa7bf15a9b573e Mon Sep 17 00:00:00 2001 From: Martti Malmi Date: Fri, 2 Feb 2024 15:22:38 +0200 Subject: [PATCH] notifs style --- .../Pages/Notifications/NotificationGroup.tsx | 25 +++++++++---------- .../src/Pages/Notifications/Notifications.tsx | 4 +-- .../Notifications/notificationContext.tsx | 3 +-- 3 files changed, 14 insertions(+), 18 deletions(-) diff --git a/packages/app/src/Pages/Notifications/NotificationGroup.tsx b/packages/app/src/Pages/Notifications/NotificationGroup.tsx index c8c87f5a..9a64e4d3 100644 --- a/packages/app/src/Pages/Notifications/NotificationGroup.tsx +++ b/packages/app/src/Pages/Notifications/NotificationGroup.tsx @@ -104,7 +104,17 @@ export function NotificationGroup({ }; return ( -
+
{ + if (!context) return; + if (onClick) { + onClick(context); + } else { + navigate(`/${context.encode(CONFIG.eventLinkPrefix)}`); + } + }}> {inView && ( <>
@@ -137,18 +147,7 @@ export function NotificationGroup({ )}
)} - {context && ( - { - if (onClick) { - onClick(context); - } else { - navigate(`/${context.encode(CONFIG.eventLinkPrefix)}`); - } - }} - /> - )} + {context && }
)} diff --git a/packages/app/src/Pages/Notifications/Notifications.tsx b/packages/app/src/Pages/Notifications/Notifications.tsx index 8135c9fc..c6d7e3e1 100644 --- a/packages/app/src/Pages/Notifications/Notifications.tsx +++ b/packages/app/src/Pages/Notifications/Notifications.tsx @@ -32,9 +32,7 @@ export default function NotificationsPage({ onClick }: { onClick?: (link: NostrL }; const myNotifications = useMemo(() => { - return notifications.filter( - a => !isMuted(a.pubkey) && a.tags.some(b => b[0] === "p" && b[1] === login.publicKey), - ); + return notifications.filter(a => !isMuted(a.pubkey) && a.tags.some(b => b[0] === "p" && b[1] === login.publicKey)); }, [notifications, login.publicKey]); const timeGrouped = useMemo(() => { diff --git a/packages/app/src/Pages/Notifications/notificationContext.tsx b/packages/app/src/Pages/Notifications/notificationContext.tsx index 02037d12..9a266d48 100644 --- a/packages/app/src/Pages/Notifications/notificationContext.tsx +++ b/packages/app/src/Pages/Notifications/notificationContext.tsx @@ -5,7 +5,7 @@ import { LiveEvent } from "@/Components/LiveStream/LiveEvent"; import Text from "@/Components/Text/Text"; import ProfilePreview from "@/Components/User/ProfilePreview"; -export function NotificationContext({ link, onClick }: { link: NostrLink; onClick: () => void }) { +export function NotificationContext({ link }: { link: NostrLink }) { const ev = useEventFeed(link); if (link.type === NostrPrefix.PublicKey) { return } />; @@ -23,7 +23,6 @@ export function NotificationContext({ link, onClick }: { link: NostrLink; onClic truncate={120} disableLinkPreview={true} className="content" - onClick={onClick} /> ); }