From 234ef1bc85d04d7a4d6dc3875d1a9a037c8480f3 Mon Sep 17 00:00:00 2001 From: Hailey Date: Mon, 10 Jun 2024 10:49:15 -0700 Subject: [PATCH] show newskie for seven days --- src/screens/Profile/Header/Handle.tsx | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/screens/Profile/Header/Handle.tsx b/src/screens/Profile/Header/Handle.tsx index 7a4485e1c4..97093c912a 100644 --- a/src/screens/Profile/Header/Handle.tsx +++ b/src/screens/Profile/Header/Handle.tsx @@ -10,6 +10,8 @@ import {atoms as a, useTheme, web} from '#/alf' import {NewskieDialog} from '#/components/StarterPack/NewskieDialog' import {Text} from '#/components/Typography' +const DAYS_TO_SHOW_NEWSKIE = 7 + export function ProfileHeaderHandle({ profile, }: { @@ -18,13 +20,22 @@ export function ProfileHeaderHandle({ const t = useTheme() const invalidHandle = isInvalidHandle(profile.handle) const blockHide = profile.viewer?.blocking || profile.viewer?.blockedBy + + const isNewskie = + profile.createdAt && + Date.now() + 60e3 * 24 * DAYS_TO_SHOW_NEWSKIE > + new Date(profile.createdAt).getTime() + return ( - - - + {isNewskie && ( + + + + )} + {profile.viewer?.followedBy && !blockHide ? (