Don't show Tags on the sidebar if no tags exist. (#342)

This commit is contained in:
xPolar 2022-07-18 22:23:46 -07:00 committed by GitHub
parent cc3c63b996
commit 02644ecb73
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -238,20 +238,24 @@ export const Sidebar: React.FC<SidebarProps> = (props) => {
</button>
)}
</div>
<div>
<Heading>Tags</Heading>
<div className="mb-2">
{tags?.slice(0, 6).map((tag, index) => (
<SidebarLink key={index} to={`tag/${tag.id}`} className="">
<div
className="w-[12px] h-[12px] rounded-full"
style={{ backgroundColor: tag.color || '#efefef' }}
/>
<span className="ml-2 text-sm">{tag.name}</span>
</SidebarLink>
))}
{tags?.length ? (
<div>
<Heading>Tags</Heading>
<div className="mb-2">
{tags?.slice(0, 6).map((tag, index) => (
<SidebarLink key={index} to={`tag/${tag.id}`} className="">
<div
className="w-[12px] h-[12px] rounded-full"
style={{ backgroundColor: tag.color || '#efefef' }}
/>
<span className="ml-2 text-sm">{tag.name}</span>
</SidebarLink>
))}
</div>
</div>
</div>
) : (
<></>
)}
<div className="flex-grow" />
<RunningJobsWidget />
{/* <div className="flex w-full">