NavigationBar
Top-level navigation bar that adapts its contents based on the current viewer mode. Displays a sidebar toggle button and viewer-specific search tools (Geocoder for map, BIMSearchTool for BIM, PCSearchTool for point cloud). Hides itself when the info sidebar is open in viewers that support it.
Usage
import NavigationBar from '@collabdt/core/components/NavigationBar';
// Typically rendered at the layout level, not directly instantiated
<NavigationBar />
Props
This component accepts no props. It reads viewer state from MenusContext and sidebar state from useSidebar().
Behaviour
- Viewer-aware rendering: The component checks
currentViewerfromMenusContextto determine which search tool to display:ViewerNames.map→ rendersGeocoderViewerNames.bim→ rendersBIMSearchToolViewerNames.pointcloud→ rendersPCSearchTool
- Sidebar toggle: A menu button appears when the current viewer is BIM, point cloud, or map. Clicking it calls
toggleInfoSidebar(). - Auto-hide: When
openInfois true and the viewer needs an info sidebar, the entire NavigationBar returnsnullto avoid visual overlap. - Hover state: The sidebar toggle button transitions from 70% to 100% opacity on hover.
Design Decisions
Permissions
This component is not gated by CASL permissions.
Related
- Geocoder — map search tool
- BIMSearchTool — BIM search tool
- PCSearchTool — point cloud search tool
- Sidebar — sidebar context provider and hooks
- MenusContext — viewer state management