fix: Submenus get stuck open, closes #2938

This commit is contained in:
Tom Moor
2022-01-15 16:21:39 -08:00
parent bb29dcaccc
commit 49718f2894
3 changed files with 7 additions and 6 deletions

View File

@@ -7,7 +7,7 @@ import {
MenuButton,
MenuItem as BaseMenuItem,
} from "reakit/Menu";
import styled from "styled-components";
import styled, { useTheme } from "styled-components";
import Flex from "~/components/Flex";
import MenuIconWrapper from "~/components/MenuIconWrapper";
import { actionToMenuItem } from "~/actions";
@@ -46,16 +46,15 @@ const Submenu = React.forwardRef(
ref: React.LegacyRef<HTMLButtonElement>
) => {
const { t } = useTranslation();
const menu = useMenuState({
modal: true,
});
const theme = useTheme();
const menu = useMenuState();
return (
<>
<MenuButton ref={ref} {...menu} {...rest}>
{(props) => (
<MenuAnchor {...props}>
{title} <Disclosure color="currentColor" />
{title} <Disclosure color={theme.textTertiary} />
</MenuAnchor>
)}
</MenuButton>