From 32dabcff9c3bc9b94c007f59a0c544c2534427cd Mon Sep 17 00:00:00 2001 From: taDuc Date: Wed, 10 Jun 2026 13:03:53 +0700 Subject: [PATCH] feat: add hasAnyBottomPanel prop to PreviewMapShell to allow custom bottom panel positioning --- src/uhm/components/preview/PreviewMapShell.tsx | 5 ++++- src/uhm/components/preview/PublicPreviewClientPage.tsx | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/uhm/components/preview/PreviewMapShell.tsx b/src/uhm/components/preview/PreviewMapShell.tsx index 7171c6e..9daf660 100644 --- a/src/uhm/components/preview/PreviewMapShell.tsx +++ b/src/uhm/components/preview/PreviewMapShell.tsx @@ -61,6 +61,7 @@ type Props = { sidebarHeight?: number; onSidebarHeightChange?: (height: number) => void; showViewportControls?: boolean; + hasAnyBottomPanel?: boolean; }; export default function PreviewMapShell({ @@ -109,6 +110,7 @@ export default function PreviewMapShell({ sidebarHeight, onSidebarHeightChange, showViewportControls = true, + hasAnyBottomPanel = false, }: Props) { const [isMenuOpen, setIsMenuOpen] = useState(false); const [avatarUrl, setAvatarUrl] = useState(null); @@ -138,6 +140,7 @@ export default function PreviewMapShell({ }, []); const hasWikiSidebar = Boolean(activeEntity || activeWiki || isWikiLoading || wikiError); + const hasBottomPanel = hasWikiSidebar || hasAnyBottomPanel; const menuOptionStyle: CSSProperties = { width: 46, @@ -213,7 +216,7 @@ export default function PreviewMapShell({ style={{ position: "absolute", top: 10, - bottom: (hasWikiSidebar && isMobileOrTablet) ? `${(sidebarHeight || 400) + 20}px` : 20, + bottom: (hasBottomPanel && isMobileOrTablet) ? `${(sidebarHeight || 400) + 20}px` : 20, left: 18, zIndex: 18, display: "flex", diff --git a/src/uhm/components/preview/PublicPreviewClientPage.tsx b/src/uhm/components/preview/PublicPreviewClientPage.tsx index b1711e1..d7c32f2 100644 --- a/src/uhm/components/preview/PublicPreviewClientPage.tsx +++ b/src/uhm/components/preview/PublicPreviewClientPage.tsx @@ -840,6 +840,7 @@ export default function PublicPreviewClientPage({ showViewportControls={false} onPlayPreviewReplay={activeReplay && replayMode === "idle" ? handlePlayPreviewReplay : undefined} timelineDisabled={replayMode !== "idle"} + hasAnyBottomPanel={isWikiChooserOpen || isGeometryChooserOpen} overlay={ replayMode !== "idle" ? (