fix: added permission check for count visibility

pull/3470/head
Brandon 2 years ago committed by Brandon Cohen
parent 81125c94f8
commit 630ebe3f2a

@ -169,7 +169,10 @@ const MobileMenu = ({
className: 'h-5 w-5',
})}
<span className="ml-2">{link.content}</span>
{link.href === '/requests' && pendingRequestsCount && (
{link.href === '/requests' &&
pendingRequestsCount &&
pendingRequestsCount > 0 &&
hasPermission(Permission.MANAGE_REQUESTS) && (
<div className="ml-auto">
<Badge badgeType="gradient">
{pendingRequestsCount < 100
@ -178,7 +181,10 @@ const MobileMenu = ({
</Badge>
</div>
)}
{link.href === '/issues' && openIssuesCount && (
{link.href === '/issues' &&
openIssuesCount &&
openIssuesCount &&
hasPermission(Permission.MANAGE_ISSUES) && (
<div className="ml-auto">
<Badge badgeType="gradient">
{openIssuesCount < 100 ? openIssuesCount : '99+'}
@ -210,7 +216,9 @@ const MobileMenu = ({
className: 'h-6 w-6',
}
)}
{link.href === '/requests' && pendingRequestsCount && (
{link.href === '/requests' &&
pendingRequestsCount &&
hasPermission(Permission.MANAGE_REQUESTS) && (
<div className="absolute left-3 bottom-2.5">
<span className="inline-flex whitespace-nowrap rounded-full border border-white bg-gradient-to-br from-indigo-600 to-purple-600 px-1 text-xs font-semibold !text-indigo-100 shadow-black">
{pendingRequestsCount < 100

@ -264,7 +264,8 @@ const Sidebar = ({
)}
{sidebarLink.messagesKey === 'requests' &&
pendingRequestsCount &&
pendingRequestsCount > 0 && (
pendingRequestsCount > 0 &&
hasPermission(Permission.MANAGE_REQUESTS) && (
<div className="ml-auto">
<Badge badgeType="gradient">
{pendingRequestsCount < 100
@ -275,7 +276,8 @@ const Sidebar = ({
)}
{sidebarLink.messagesKey === 'issues' &&
openIssuesCount &&
openIssuesCount > 0 && (
openIssuesCount > 0 &&
hasPermission(Permission.MANAGE_ISSUES) && (
<div className="ml-auto">
<Badge badgeType="gradient">
{openIssuesCount < 100

Loading…
Cancel
Save