Add backdrop under mainmenu on mobile.
This commit is contained in:
parent
b63d17045e
commit
8f8b6e7144
@ -21,6 +21,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@dwelle/tunnel-rat": "0.1.1",
|
"@dwelle/tunnel-rat": "0.1.1",
|
||||||
"@radix-ui/react-dropdown-menu": "2.0.4",
|
"@radix-ui/react-dropdown-menu": "2.0.4",
|
||||||
|
"@radix-ui/react-portal": "1.0.2",
|
||||||
"@sentry/browser": "6.2.5",
|
"@sentry/browser": "6.2.5",
|
||||||
"@sentry/integrations": "6.2.5",
|
"@sentry/integrations": "6.2.5",
|
||||||
"@testing-library/jest-dom": "5.16.2",
|
"@testing-library/jest-dom": "5.16.2",
|
||||||
|
@ -16,6 +16,8 @@ import { composeEventHandlers } from "../../utils";
|
|||||||
import { useTunnels } from "../context/tunnels";
|
import { useTunnels } from "../context/tunnels";
|
||||||
import DropdownMenuSub from "../dropdownMenu/DropdownMenuSub";
|
import DropdownMenuSub from "../dropdownMenu/DropdownMenuSub";
|
||||||
|
|
||||||
|
import * as Portal from "@radix-ui/react-portal";
|
||||||
|
|
||||||
const MainMenu = Object.assign(
|
const MainMenu = Object.assign(
|
||||||
withInternalFallback(
|
withInternalFallback(
|
||||||
"MainMenu",
|
"MainMenu",
|
||||||
@ -39,6 +41,17 @@ const MainMenu = Object.assign(
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<mainMenuTunnel.In>
|
<mainMenuTunnel.In>
|
||||||
|
{appState.openMenu === "canvas" && device.isMobile && (
|
||||||
|
<Portal.Root
|
||||||
|
style={{
|
||||||
|
backgroundColor: "rgba(18, 18, 18, 0.2)",
|
||||||
|
position: "fixed",
|
||||||
|
inset: "0px",
|
||||||
|
zIndex: "var(--zIndex-layerUI)",
|
||||||
|
}}
|
||||||
|
onClick={() => setAppState({ openMenu: null })}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
<DropdownMenu open={appState.openMenu === "canvas"}>
|
<DropdownMenu open={appState.openMenu === "canvas"}>
|
||||||
<DropdownMenu.Trigger
|
<DropdownMenu.Trigger
|
||||||
onToggle={() => {
|
onToggle={() => {
|
||||||
@ -50,6 +63,7 @@ const MainMenu = Object.assign(
|
|||||||
{HamburgerMenuIcon}
|
{HamburgerMenuIcon}
|
||||||
</DropdownMenu.Trigger>
|
</DropdownMenu.Trigger>
|
||||||
<DropdownMenu.Content
|
<DropdownMenu.Content
|
||||||
|
// style={{ zIndex: 11 }}
|
||||||
sideOffset={device.isMobile ? 20 : undefined}
|
sideOffset={device.isMobile ? 20 : undefined}
|
||||||
className="mainmenu-content"
|
className="mainmenu-content"
|
||||||
onClickOutside={onClickOutside}
|
onClickOutside={onClickOutside}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user