From bee566424d20c822cb5d914f1834cc28107436d5 Mon Sep 17 00:00:00 2001 From: enes Date: Fri, 30 Aug 2024 12:55:04 +0200 Subject: [PATCH] refactor: split signers and viewers in the users section --- src/components/UsersDetails.tsx/index.tsx | 60 ++++++++++++++--------- 1 file changed, 36 insertions(+), 24 deletions(-) diff --git a/src/components/UsersDetails.tsx/index.tsx b/src/components/UsersDetails.tsx/index.tsx index 16ff440..bddae82 100644 --- a/src/components/UsersDetails.tsx/index.tsx +++ b/src/components/UsersDetails.tsx/index.tsx @@ -118,32 +118,44 @@ export const UsersDetails = ({ meta }: UsersDetailsProps) => { ) })} - {viewers.map((signer) => { - const pubkey = npubToHex(signer)! - const profile = profiles[pubkey] - - return ( - - - - - - ) - })} + + {viewers.length > 0 && ( + <> +

Viewers

+
+ + {viewers.map((signer) => { + const pubkey = npubToHex(signer)! + const profile = profiles[pubkey] + + return ( + + + + + + ) + })} + +
+ + )}

Details