Skip to content

Commit 5753788

Browse files
committed
DBC22-6899: expand isInBc for neighbouring regions and US
1 parent c086818 commit 5753788

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

src/frontend/src/Components/routing/NoRouteFound.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,21 @@ import './NoRouteFound.scss';
1313
export default function NoRouteFound(props) {
1414
const { searchedRoutes, searchLocationFrom, searchLocationTo } = props;
1515

16+
// BC plus neighbouring provinces/territories and US border locations we list as routable
17+
const isInBcRegion = (label) => (
18+
label.includes(', BC') ||
19+
label.includes(', AB') ||
20+
label.includes(', YT') ||
21+
label.includes(', NT') ||
22+
label.includes(', US')
23+
);
24+
1625
const isInBc = (searchLocationFrom, searchLocationTo) => {
1726
return searchLocationFrom[0] && searchLocationTo[0] && (
18-
(searchLocationFrom[0].label.includes(', BC') && searchLocationTo[0].label.includes(', BC')) ||
27+
(isInBcRegion(searchLocationFrom[0].label) && isInBcRegion(searchLocationTo[0].label)) ||
1928
(searchLocationFrom[0].label.includes('Current location'))
2029
);
21-
}
30+
}
2231

2332
// Rendering
2433
return (

0 commit comments

Comments
 (0)