Skip to content

Commit

Permalink
Don't show 'Abonnementen' title if no Abonnementen are found
Browse files Browse the repository at this point in the history
  • Loading branch information
bartwr committed Apr 11, 2024
1 parent 704b8c8 commit a501f58
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/components/parking/ParkingViewAbonnementen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ const ParkingViewAbonnementen = ({ parkingdata }: { parkingdata: ParkingDetailsT
(state: any) => state.map.activeMunicipalityInfo
);

// console.log('activeMunicipalityInfo', activeMunicipalityInfo);
// parkingdata.abonnementsvorm_fietsenstalling.map(x => console.log('abonnement', x));
// console.log("abonnementsvormen", JSON.stringify(parkingdata.abonnementsvorm_fietsenstalling, null, 2));
// Don't render HTML if no subscriptions are available
if (!parkingdata.abonnementsvorm_fietsenstalling || parkingdata.abonnementsvorm_fietsenstalling.length <= 0) {
return <></>
}

return (
<>
Expand All @@ -31,13 +32,13 @@ const ParkingViewAbonnementen = ({ parkingdata }: { parkingdata: ParkingDetailsT
<div className="text-right sm:text-center">&euro;{x.abonnementsvormen.prijs?.toLocaleString('nl-NL') || "---"}</div>
</Fragment>
}) : <></>}
{(parkingdata.abonnementsvorm_fietsenstalling && parkingdata.abonnementsvorm_fietsenstalling.length > 0) && <div className="text-right sm:text-center">
<div className="text-right sm:text-center">
<Button className="mt-4" onClick={() => {
window.open(`https://veiligstallen.nl/${activeMunicipalityInfo ? activeMunicipalityInfo.UrlName : 'utrecht'}/abonnement`, '_blank');
}}>
Koop abonnement
</Button>
</div>}
</div>
</div>
</SectionBlock>

Expand Down

0 comments on commit a501f58

Please sign in to comment.