Skip to content

Commit

Permalink
feature: add carpool disclaimer for carpool legs
Browse files Browse the repository at this point in the history
  • Loading branch information
hbruch committed Apr 18, 2024
1 parent 7e5e36d commit 93aeaf0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
19 changes: 19 additions & 0 deletions app/component/ItineraryTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ class ItineraryTab extends React.Component {
);
};

shouldShowCarpoolDisclaimer = (itinerary, config) => {
const hasCarpoolLegs = itinerary.legs.some(l => l.mode === 'CARPOOL');
return hasCarpoolLegs && config.carpoolDisclaimer;
};

printItinerary = e => {
e.stopPropagation();

Expand Down Expand Up @@ -236,6 +241,7 @@ class ItineraryTab extends React.Component {
}
}
}

const suggestionIndex = this.context.match.params.secondHash
? Number(this.context.match.params.secondHash) + 1
: Number(this.context.match.params.hash) + 1;
Expand Down Expand Up @@ -338,6 +344,19 @@ class ItineraryTab extends React.Component {
focusToLeg={this.props.focusToLeg}
toggleCarpoolDrawer={this.props.toggleCarpoolDrawer}
/>
{ this.shouldShowCarpoolDisclaimer(itinerary, config) && (
<div className="itinerary-disclaimer">
<div className="info-container">
<div className="icon-container">
<Icon className="info" img="icon-icon_info" />
</div>
<div className="description-container">
{config.carpoolDisclaimer}
</div>
</div>
</div>
)}

{shouldShowFareInfo(config) && (
<TicketInformation
fares={fares}
Expand Down
3 changes: 3 additions & 0 deletions app/configurations/config.vpe.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,4 +259,7 @@ export default configMerger(parentConfig, {

// live bus locations
vehicles: false,

// Disclaimer shown if trip has a leg with mode=CARPOOL
carpoolDisclaimer: 'Der VPE stellt lediglich die Plattform zur Verfügung, auf der Personen Mitfahrangebote veröffentlichen können, um von möglichen Mitfahrer*innen kontaktiert zu werden. Der VPE ist weder an einer etwaigen Vereinbarung zwischen Fahrenden und Mitfahrenden beteiligt noch haftet er für deren Verhalten im Zusammenhang mit der Durchführung der Fahrt, den Zustand des eingesetzten Fahrzeugs oder das Zustandekommen der Fahrt.',
});

0 comments on commit 93aeaf0

Please sign in to comment.