From 434b8b9dbe2f29b4ecbdd61aab0e45d23fafa053 Mon Sep 17 00:00:00 2001 From: Ian Philips Date: Wed, 6 Jul 2022 07:51:32 -0600 Subject: [PATCH] Just show first names to save space --- web/components/notifications-icon.tsx | 2 +- web/components/user-page.tsx | 5 +++-- web/pages/notifications.tsx | 14 +++++++------- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/web/components/notifications-icon.tsx b/web/components/notifications-icon.tsx index ac4d772f..8f45a054 100644 --- a/web/components/notifications-icon.tsx +++ b/web/components/notifications-icon.tsx @@ -19,7 +19,7 @@ export default function NotificationsIcon(props: { className?: string }) { useEffect(() => { if (!privateUser) return - if (Date.now() - (privateUser.lastTimeCheckedBonuses ?? 0) > 60 * 1000) + if (Date.now() - (privateUser.lastTimeCheckedBonuses ?? 0) > 65 * 1000) requestBonuses({}).catch((error) => { console.log("couldn't get bonuses:", error.message) }) diff --git a/web/components/user-page.tsx b/web/components/user-page.tsx index 07f722d7..c33476aa 100644 --- a/web/components/user-page.tsx +++ b/web/components/user-page.tsx @@ -45,15 +45,16 @@ export function UserLink(props: { username: string showUsername?: boolean className?: string + justFirstName?: boolean }) { - const { name, username, showUsername, className } = props + const { name, username, showUsername, className, justFirstName } = props return ( - {name} + {justFirstName ? name.split(' ')[0] : name} {showUsername && ` (@${username})`} ) diff --git a/web/pages/notifications.tsx b/web/pages/notifications.tsx index 185225e9..2c6c2433 100644 --- a/web/pages/notifications.tsx +++ b/web/pages/notifications.tsx @@ -783,13 +783,12 @@ function NotificationItem(props: {
- {sourceType != 'bonus' && ( - - )} +
{sourceType && @@ -845,6 +844,7 @@ function NotificationItem(props: { name={sourceUserName || ''} username={sourceUserUsername || ''} className={'mr-0 flex-shrink-0'} + justFirstName={true} /> )}