From 2d465a09edc875c86e1b73f45625e47c56e789d6 Mon Sep 17 00:00:00 2001 From: Nanda Date: Mon, 17 Aug 2026 15:51:33 +1000 Subject: [PATCH] Show no UI when MapInteractionMode message is empty. --- .../Notification/MapInteractionWindow.tsx | 28 ++++++++++++------- .../Notification/map-interaction-window.scss | 4 +++ 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/packages/terriajs/lib/ReactViews/Notification/MapInteractionWindow.tsx b/packages/terriajs/lib/ReactViews/Notification/MapInteractionWindow.tsx index d0d7e6011c0..9be3ba888b8 100644 --- a/packages/terriajs/lib/ReactViews/Notification/MapInteractionWindow.tsx +++ b/packages/terriajs/lib/ReactViews/Notification/MapInteractionWindow.tsx @@ -131,22 +131,30 @@ class MapInteractionWindow extends Component<{ const isDiffTool = this.currentInteractionMode?.uiMode === UIMode.Difference; + const message = isDefined(this.currentInteractionMode) + ? parseCustomHtmlToReact(this.currentInteractionMode.message()) + : undefined; + const messageAsNode = isDefined(this.currentInteractionMode) + ? this.currentInteractionMode.messageAsNode() + : undefined; + return ( -
- {isDefined(this.currentInteractionMode) && - parseCustomHtmlToReact(this.currentInteractionMode.message())} - {isDefined(this.currentInteractionMode) && - this.currentInteractionMode.messageAsNode()} -
+ {message || + (messageAsNode && ( +
+ {message} + {messageAsNode} +
+ ))} {typeof this.currentInteractionMode?.customUi === "function" && this.currentInteractionMode.customUi()} {this.currentInteractionMode?.onCancel && ( diff --git a/packages/terriajs/lib/ReactViews/Notification/map-interaction-window.scss b/packages/terriajs/lib/ReactViews/Notification/map-interaction-window.scss index 6dd99593b40..8dcf233928c 100644 --- a/packages/terriajs/lib/ReactViews/Notification/map-interaction-window.scss +++ b/packages/terriajs/lib/ReactViews/Notification/map-interaction-window.scss @@ -13,6 +13,10 @@ z-index: 999; color: #000; padding: variables.$padding; + + &:empty { + padding: 0; + } } .isActive {