Skip to content

Commit

Permalink
DBC22-2584: added missing states
Browse files Browse the repository at this point in the history
  • Loading branch information
ray-oxd committed Aug 21, 2024
1 parent de1a993 commit bc57e02
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/frontend/src/Components/map/Map.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ export default function DriveBCMap(props) {
weathers: mapContext.visible_layers.weather,
restStops: mapContext.visible_layers.restStops
});
const [showSpinner, setShowSpinner] = useState(false);

// Workaround for OL handlers not being able to read states
const [clickedFeature, setClickedFeature] = useState();
Expand Down Expand Up @@ -556,7 +557,7 @@ export default function DriveBCMap(props) {
{smallScreen && (
<ExitSurvey mobile={true} />
)}
<RouteSearch ref={routingContainerRef} routeEdit={true} showSpinner={false} onShowSpinnerChange={()=>{}}/>
<RouteSearch ref={routingContainerRef} routeEdit={true} showSpinner={showSpinner} onShowSpinnerChange={setShowSpinner}/>
<AdvisoriesWidget advisories={advisoriesInView} updateClickedFeature={updateClickedFeature} open={openPanel} clickedFeature={clickedFeature} clickedFeatureRef={clickedFeatureRef} onMap={true} />
</div>
)}
Expand Down
3 changes: 2 additions & 1 deletion src/frontend/src/pages/EventsListPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ export default function EventsListPage() {
const [showServerError, setShowServerError] = useState(false);
const [openAdvisoriesOverlay, setOpenAdvisoriesOverlay] = useState(false);
const [openSearchOverlay, setOpenSearchOverlay] = useState(false);
const [showSpinner, setShowSpinner] = useState(false);

// Error handling
const displayError = (error) => {
Expand Down Expand Up @@ -462,7 +463,7 @@ export default function EventsListPage() {

<p className="overlay__header bold">Find route</p>

<RouteSearch showFilterText={true} showSpinner={false} onShowSpinnerChange={()=>{}}/>
<RouteSearch showFilterText={true} showSpinner={showSpinner} onShowSpinnerChange={setShowSpinner}/>
</div>
}
</React.Fragment>
Expand Down

0 comments on commit bc57e02

Please sign in to comment.