Skip to content

Commit

Permalink
Reduce re-render of elements (#2440)
Browse files Browse the repository at this point in the history
* add useMapLoaded

* reduce re-renders in app-bar
  • Loading branch information
cphelefu authored Aug 27, 2024
1 parent 1d44286 commit e58fac1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/geoview-core/src/core/containers/shell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -309,14 +309,14 @@ export function Shell(props: ShellProps): JSX.Element {
<CircularProgress isLoaded={mapLoaded} />
<CircularProgress isLoaded={!circularProgressActive} />
<Box id={`map-${mapViewer.mapId}`} sx={sxClasses.mapShellContainer} className="mapContainer" ref={mapShellContainerRef}>
<AppBar api={mapViewer.appBarApi} />
{ mapLoaded && <AppBar api={mapViewer.appBarApi} /> }
<Box sx={sxClasses.mapContainer} ref={mapContainerRef}>
<Map viewer={mapViewer} />
<MapInfo />
</Box>
{interaction === 'dynamic' && <NavBar api={mapViewer.navBarApi} />}
</Box>
{geoviewConfig!.footerBar !== undefined && <FooterBar api={mapViewer.footerBarApi} />}
{geoviewConfig!.footerBar !== undefined && mapLoaded && <FooterBar api={mapViewer.footerBarApi} />}
{Object.keys(mapViewer.modal.modals).map((modalId) => (
<Modal
key={modalId}
Expand Down

0 comments on commit e58fac1

Please sign in to comment.