Elevate alerts above troubleshoot

Summary: Similar treatment to troubleshoot problem

Reviewed By: lblasa

Differential Revision: D47720741

fbshipit-source-id: 6875988a9a0763cb4ed473d6e8522581fc27bef3
This commit is contained in:
Luke De Feo
2023-07-25 07:28:03 -07:00
committed by Facebook GitHub Bot
parent e0da5332d4
commit 7a5ad8a92d

View File

@@ -237,6 +237,7 @@ function NotificationButton({
<NavbarButton <NavbarButton
icon={BellOutlined} icon={BellOutlined}
label="Alerts" label="Alerts"
zIndex={AlertsZIndex}
toggled={toplevelSelection === 'notification'} toggled={toplevelSelection === 'notification'}
count={activeNotifications.length} count={activeNotifications.length}
onClick={() => setToplevelSelection('notification')} onClick={() => setToplevelSelection('notification')}
@@ -327,10 +328,12 @@ export function NavbarButton({
count, count,
disabled = false, disabled = false,
flipIcon = false, flipIcon = false,
zIndex,
}: { }: {
icon: (props: any) => any; icon: (props: any) => any;
label: string; label: string;
// TODO remove optional // TODO remove optional
zIndex?: number;
onClick?: () => void; onClick?: () => void;
toggled?: boolean; toggled?: boolean;
count?: number | true; count?: number | true;
@@ -374,6 +377,7 @@ export function NavbarButton({
if (count !== undefined) { if (count !== undefined) {
return ( return (
<Badge <Badge
style={{zIndex: zIndex}}
{...{onClick}} {...{onClick}}
dot={count === true} dot={count === true}
count={count} count={count}
@@ -465,6 +469,9 @@ const submenu = css`
} }
`; `;
const AlertsZIndex = 101;
const TroubleShootZIndex = 100;
function TroubleshootMenu({ function TroubleshootMenu({
setToplevelSelection, setToplevelSelection,
}: { }: {
@@ -500,7 +507,7 @@ function TroubleshootMenu({
return ( return (
<> <>
{/* using Badge **here** as NavbarButton badge is being cut off by Menu component */} {/* using Badge **here** as NavbarButton badge is being cut off by Menu component */}
<Badge {...badgeProps} style={{zIndex: 100}}> <Badge {...badgeProps} style={{zIndex: TroubleShootZIndex}}>
<Menu <Menu
mode="vertical" mode="vertical"
className={menu} className={menu}