From 6a286432153c1b48b69e7d19ceaef52380129e5c Mon Sep 17 00:00:00 2001 From: Ian Philips Date: Thu, 14 Jul 2022 11:48:04 -0600 Subject: [PATCH] Notifications ux --- web/pages/notifications.tsx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/web/pages/notifications.tsx b/web/pages/notifications.tsx index 2001c557..250fae37 100644 --- a/web/pages/notifications.tsx +++ b/web/pages/notifications.tsx @@ -36,6 +36,7 @@ import { groupBy, sum, uniq } from 'lodash' import Custom404 from 'web/pages/404' import { track } from '@amplitude/analytics-browser' import { Pagination } from 'web/components/pagination' +import { useWindowSize } from 'web/hooks/use-window-size' export const NOTIFICATIONS_PER_PAGE = 30 const MULTIPLE_USERS_KEY = 'multipleUsers' @@ -183,7 +184,7 @@ function IncomeNotificationGroupItem(props: { const groupedNotificationsBySourceTitle = groupBy( groupedNotificationsBySourceType[sourceType], (notification) => { - return notification.sourceTitle + return notification.sourceTitle ?? notification.sourceContractTitle } ) for (const contractId in groupedNotificationsBySourceTitle) { @@ -314,7 +315,8 @@ function IncomeNotificationItem(props: { const { notification, justSummary } = props const { sourceType, sourceUserName, sourceUserUsername } = notification const [highlighted] = useState(!notification.isSeen) - + const { width } = useWindowSize() + const isMobile = (width && width < 768) || false useEffect(() => { setNotificationsAsSeen([notification]) }, [notification]) @@ -351,7 +353,7 @@ function IncomeNotificationItem(props: { {getReasonForShowingIncomeNotification(true)} @@ -406,6 +408,8 @@ function NotificationGroupItem(props: { const { notificationGroup, className } = props const { notifications } = notificationGroup const { sourceContractTitle } = notifications[0] + const { width } = useWindowSize() + const isMobile = (width && width < 768) || false const numSummaryLines = 3 const [expanded, setExpanded] = useState(false) @@ -445,7 +449,10 @@ function NotificationGroupItem(props: {
Activity on - +