Skip to content

Commit

Permalink
DBC22-2253: hide Advisories route text if no route is selected
Browse files Browse the repository at this point in the history
  • Loading branch information
ray-oxd committed May 29, 2024
1 parent 113483a commit 23a6ea8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/frontend/src/Components/advisories/Advisories.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import AdvisoriesList from './AdvisoriesList';
import './Advisories.scss';

export default function Advisories(props) {
const { advisories } = props;
const { advisories, selectedRoute } = props;

return (advisories && !!advisories.length) ? (
<div className="advisories">
Expand All @@ -28,7 +28,9 @@ export default function Advisories(props) {
in effect
</h2>

<p className="description">The following advisory affects a portion of the route you’ve chosen:</p>
{selectedRoute && selectedRoute.routeFound && Object.keys(selectedRoute).length !== 0 &&
<p className="description">The following advisory affects a portion of the route you’ve chosen:</p>
}

<AdvisoriesList advisories={advisories} showDescription={false} showTimestamp={false} />
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/src/pages/CamerasListPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ export default function CamerasListPage() {
</PageHeader>

<Container className="outer-container">
<Advisories advisories={advisoriesInRoute} />
<Advisories advisories={advisoriesInRoute} selectedRoute={selectedRoute} />

<div className="controls-container">
<div className="route-display-container">
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/src/pages/EventsListPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ export default function EventsListPage() {
</PageHeader>

<Container>
<Advisories advisories={advisoriesInRoute} />
<Advisories advisories={advisoriesInRoute} selectedRoute={selectedRoute} />

<div className="controls-container">
{ largeScreen &&
Expand Down

0 comments on commit 23a6ea8

Please sign in to comment.