Skip to content

Commit

Permalink
Hide NS parkings on municipality parkings page
Browse files Browse the repository at this point in the history
  • Loading branch information
bartwr committed Apr 6, 2024
1 parent 950aff3 commit 0a12ebc
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/pages/content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,14 @@ const Content: NextPage = ({ fietsenstallingen }) => {
>
{parkingTypesToFilterOn && <ParkingFacilityBrowser
customFilter={(x) => {
return parkingTypesToFilterOn.indexOf(x.Type) > -1 && activeMunicipalityInfo.CompanyName?.toLowerCase().indexOf(x.Plaats?.toLowerCase()) > -1;
return parkingTypesToFilterOn.indexOf(x.Type) > -1
&& (
// Check if parking municipality == active municipality
(activeMunicipalityInfo.CompanyName && activeMunicipalityInfo.CompanyName.toLowerCase().indexOf(x.Plaats?.toLowerCase()) > -1)
// Hide parkings without municipality, if municipality is set
// This makes sure not all Dutch NS stallingen are shown on a municipality page
&& (x.Plaats && x.Plaats.length > 0)
);
}}
onShowStallingDetails={(id: any) => {
setCurrentStallingId(id);
Expand Down

0 comments on commit 0a12ebc

Please sign in to comment.