diff --git a/src/components/topbar/topbar.tsx b/src/components/topbar/topbar.tsx index aa4a138d..f13a99f5 100644 --- a/src/components/topbar/topbar.tsx +++ b/src/components/topbar/topbar.tsx @@ -63,46 +63,49 @@ const TopBarDesktop = () => { const { plebbitSubs, interestsSubs, randomSubs, internationalSubs, projectsSubs } = categorizeSubplebbits(subplebbits); - const renderSubplebbits = (subplebbits: any) => { - return subplebbits.map((sub: any, index: any) => ( - - {index === 0 ? null : ' '} - {sub.address.includes('.') ? sub.address : sub.address.slice(0, 10).concat('...')} - {index !== subplebbits.length - 1 ? ' /' : null} - - )); - }; + const renderSubplebbits = (subplebbits: any) => + subplebbits.length > 0 && ( + <> + [ + {subplebbits.map((sub: any, index: any) => ( + + {index === 0 ? null : ' '} + {sub.address.includes('.') ? sub.address : sub.address.slice(0, 10).concat('...')} + {index !== subplebbits.length - 1 ? ' /' : null} + + ))} + ]{' '} + > + ); return (