From 8d35d476e3e90fd8a6183ab105a9ffc79d76e121 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Thu, 15 Jun 2023 18:03:37 +0800 Subject: [PATCH] Fix nav menu overlapping tab bar Also allow custom padding into safeBoundingBoxPadding function --- src/components/nav-menu.jsx | 10 +++++++++- ...ng-box-padding.jsx => safe-bounding-box-padding.js} | 8 ++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) rename src/utils/{safe-bounding-box-padding.jsx => safe-bounding-box-padding.js} (78%) diff --git a/src/components/nav-menu.jsx b/src/components/nav-menu.jsx index 7ac55fb8..116a8618 100644 --- a/src/components/nav-menu.jsx +++ b/src/components/nav-menu.jsx @@ -6,6 +6,7 @@ import { useLongPress } from 'use-long-press'; import { useSnapshot } from 'valtio'; import { api } from '../utils/api'; +import safeBoundingBoxPadding from '../utils/safe-bounding-box-padding'; import states from '../utils/states'; import store from '../utils/store'; @@ -52,6 +53,13 @@ function NavMenu(props) { const buttonRef = useRef(); const [menuState, setMenuState] = useState(undefined); + const boundingBoxPadding = safeBoundingBoxPadding([ + 0, + 0, + snapStates.settings.shortcutsViewMode === 'tab-menu-bar' ? 50 : 0, + 0, + ]); + return ( <>