From 2a7ad32dfa1bf0a891638193e02850316043be3c Mon Sep 17 00:00:00 2001 From: Hailey Date: Tue, 18 Jun 2024 09:27:21 -0700 Subject: [PATCH] use new time ago hook --- src/components/StarterPack/NewskieDialog.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/StarterPack/NewskieDialog.tsx b/src/components/StarterPack/NewskieDialog.tsx index ca3516cb92..4f85ecd234 100644 --- a/src/components/StarterPack/NewskieDialog.tsx +++ b/src/components/StarterPack/NewskieDialog.tsx @@ -5,7 +5,7 @@ import {msg, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' import {HITSLOP_10} from 'lib/constants' -import {ago} from 'lib/strings/time' +import {useTimeAgo} from 'lib/hooks/useTimeAgo' import {isNative} from 'platform/detection' import {useSession} from 'state/session' import {atoms as a, useTheme} from '#/alf' @@ -27,6 +27,7 @@ export function NewskieDialog({ const {joinedViaStarterPack} = profile const profileName = profile.displayName || `@${profile.handle}` const createdAt = profile.createdAt ?? 0 + const timeAgo = useTimeAgo(createdAt, {format: 'long'}) return ( <> @@ -53,7 +54,7 @@ export function NewskieDialog({ joinedViaStarterPack?.record, ) ? ( - {profileName} joined Bluesky {ago(createdAt, true)} ago with{' '} + {profileName} joined Bluesky {timeAgo} ago with{' '} {joinedViaStarterPack?.creator.did === currentAccount?.did ? 'your' : `${joinedViaStarterPack?.creator.displayName}'s` || @@ -63,7 +64,7 @@ export function NewskieDialog({ ) : ( {profileName}{' '} - recently joined Bluesky {ago(createdAt, true)} ago + recently joined Bluesky {timeAgo} ago )}