From 15ae0bee0fe10a899a45ae42160ba5da0f0531e3 Mon Sep 17 00:00:00 2001 From: Kanika1799 Date: Thu, 18 Apr 2024 04:07:48 +0530 Subject: [PATCH] Make profile private for user block above -1 --- src/components/RetroButton.tsx | 16 ++++++++++------ src/pages/u/[userId].tsx | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/components/RetroButton.tsx b/src/components/RetroButton.tsx index ade5c19..c183795 100644 --- a/src/components/RetroButton.tsx +++ b/src/components/RetroButton.tsx @@ -53,12 +53,16 @@ export const DynamicLoginButton = () => { const { name } = user; if (user.isSignedIn) { return ( - - - - {name} - - + <> + {user?.block !== undefined && user?.block >= 0 ? ( + + + + {name} + + + ) : null} + ); } return ( diff --git a/src/pages/u/[userId].tsx b/src/pages/u/[userId].tsx index 167e533..58bf6d3 100644 --- a/src/pages/u/[userId].tsx +++ b/src/pages/u/[userId].tsx @@ -75,7 +75,7 @@ const Profile = () => { } }, [user]); - if (!user) { + if (!user || (user?.block !== undefined && user?.block < 0)) { return
User not found
; } return (